summaryrefslogtreecommitdiff
path: root/sysdeps/powerpc
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/powerpc')
-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.c (renamed from sysdeps/powerpc/fpu/s_fmax.S)43
-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.c (renamed from sysdeps/powerpc/powerpc64/strtok_r.S)16
-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.h (renamed from sysdeps/powerpc/strcat.c)25
-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_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_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.c (renamed from sysdeps/powerpc/fpu/s_fdim.c)20
-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/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.h (renamed from sysdeps/powerpc/fpu/s_fdimf.c)13
-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/Implies (renamed from sysdeps/powerpc/powerpc64/power4/Implies)1
-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.S (renamed from sysdeps/powerpc/powerpc32/power4/fpu/multiarch/w_sqrtf-power5.S)10
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_cosf-ppc64.c (renamed from sysdeps/powerpc/powerpc32/power4/fpu/multiarch/w_sqrtf-ppc32.S)12
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_cosf.c (renamed from sysdeps/powerpc/powerpc32/power4/fpu/multiarch/w_sqrtf.c)20
-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.S (renamed from sysdeps/powerpc/powerpc32/power4/fpu/multiarch/w_sqrt-power5.S)12
-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.c (renamed from sysdeps/powerpc/powerpc32/power4/fpu/multiarch/w_sqrt.c)31
-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/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.c (renamed from sysdeps/powerpc/powerpc32/power4/fpu/multiarch/w_sqrt-ppc32.S)20
-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/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/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
966 files changed, 14280 insertions, 5502 deletions
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/fpu/s_fmax.S b/sysdeps/powerpc/cpu-features.c
index 75ee74c316..955d4778a6 100644
--- a/sysdeps/powerpc/fpu/s_fmax.S
+++ b/sysdeps/powerpc/cpu-features.c
@@ -1,5 +1,5 @@
-/* Floating-point maximum. PowerPC version.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* 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
@@ -16,27 +16,24 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
+#include <stdint.h>
+#include <cpu-features.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)
+#if HAVE_TUNABLES
+# include <elf/dl-tunables.h>
+#endif
-#ifdef NO_LONG_DOUBLE
-weak_alias (__fmax,__fmaxl)
-weak_alias (__fmax,fmaxl)
+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/powerpc64/strtok_r.S b/sysdeps/powerpc/fpu/fegetmode.c
index 2df0ce42b3..b83dc9f625 100644
--- a/sysdeps/powerpc/powerpc64/strtok_r.S
+++ b/sysdeps/powerpc/fpu/fegetmode.c
@@ -1,5 +1,5 @@
-/* Optimized strtok_r implementation for PowerPC64.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+/* 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
@@ -16,9 +16,11 @@
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>
+#include <fenv_libc.h>
-weak_alias (__strtok_r, strtok_r)
-libc_hidden_def (__strtok_r)
-libc_hidden_builtin_def (strtok_r)
+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/strcat.c b/sysdeps/powerpc/fpu/math-barriers.h
index 35b2841704..6da210219e 100644
--- a/sysdeps/powerpc/strcat.c
+++ b/sysdeps/powerpc/fpu/math-barriers.h
@@ -1,5 +1,5 @@
-/* strcat version that uses fast strcpy/strlen.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* 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
@@ -16,18 +16,13 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <string.h>
+#ifndef POWERPC_MATH_BARRIERS_H
+#define POWERPC_MATH_BARRIERS_H 1
-#ifndef STRCAT
-# undef strcat
-# define STRCAT strcat
-#endif
+/* 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)); })
-/* 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)
+#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_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_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/fpu/s_fdim.c b/sysdeps/powerpc/nofpu/fesetexcept.c
index 1d4b6d0665..a3309ec435 100644
--- a/sysdeps/powerpc/fpu/s_fdim.c
+++ b/sysdeps/powerpc/nofpu/fesetexcept.c
@@ -1,5 +1,5 @@
-/* Return positive difference between arguments.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* 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
@@ -16,15 +16,13 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <math.h>
+#include "soft-supp.h"
-double
-__fdim (double x, double y)
+int
+fesetexcept (int excepts)
{
- return x <= y ? 0 : x - y;
+ __sim_exceptions_thread |= (excepts & FE_ALL_EXCEPT);
+ SIM_SET_GLOBAL (__sim_exceptions_global, __sim_exceptions_thread);
+
+ return 0;
}
-weak_alias (__fdim, fdim)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__fdim, __fdiml)
-weak_alias (__fdim, fdiml)
-#endif
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/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/fpu/s_fdimf.c b/sysdeps/powerpc/powerpc32/symbol-hacks.h
index 8c645c413a..b986020b33 100644
--- a/sysdeps/powerpc/fpu/s_fdimf.c
+++ b/sysdeps/powerpc/powerpc32/symbol-hacks.h
@@ -1,5 +1,5 @@
-/* Return positive difference between arguments.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* 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
@@ -16,11 +16,6 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <math.h>
+#include <sysdeps/wordsize-32/divdi3-symbol-hacks.h>
-float
-__fdimf (float x, float y)
-{
- return x <= y ? 0 : x - y;
-}
-weak_alias (__fdimf, fdimf)
+#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/power4/Implies b/sysdeps/powerpc/powerpc64/be/power4/Implies
index a372141bb7..6d067e28ec 100644
--- a/sysdeps/powerpc/powerpc64/power4/Implies
+++ b/sysdeps/powerpc/powerpc64/be/power4/Implies
@@ -1,2 +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/powerpc32/power4/fpu/multiarch/w_sqrtf-power5.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_cosf-power8.S
index 68b51554f3..17adc90ad2 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/w_sqrtf-power5.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_cosf-power8.S
@@ -1,5 +1,5 @@
-/* sqrtf function. PowerPC32/POWER5 version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+/* 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
@@ -16,11 +16,9 @@
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
+#define __cosf __cosf_power8
-#include <sysdeps/powerpc/powerpc32/power5/fpu/w_sqrtf.S>
+#include <sysdeps/powerpc/powerpc64/power8/fpu/s_cosf.S>
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/w_sqrtf-ppc32.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_cosf-ppc64.c
index f9d1cfef53..34e0553b93 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/w_sqrtf-ppc32.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_cosf-ppc64.c
@@ -1,5 +1,5 @@
-/* sqrtf function. PowerPC32 default version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+/* 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
@@ -16,11 +16,9 @@
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 weak_alias(a, b)
-#define __sqrtf __sqrtf_ppc32
+#define __cosf __cosf_ppc64
-#include <sysdeps/powerpc/powerpc32/power4/fpu/w_sqrtf.S>
+#include <sysdeps/powerpc/fpu/s_cosf.c>
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/w_sqrtf.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_cosf.c
index b7c8c23fd1..cb12178791 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/w_sqrtf.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_cosf.c
@@ -1,5 +1,5 @@
-/* Multiple versions of sqrtf.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+/* 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
@@ -17,16 +17,16 @@
<http://www.gnu.org/licenses/>. */
#include <math.h>
-#include <math_ldbl_opt.h>
#include <shlib-compat.h>
#include "init-arch.h"
+#include <libm-alias-float.h>
-extern __typeof (__sqrtf) __sqrtf_ppc32 attribute_hidden;
-extern __typeof (__sqrtf) __sqrtf_power5 attribute_hidden;
+extern __typeof (__cosf) __cosf_ppc64 attribute_hidden;
+extern __typeof (__cosf) __cosf_power8 attribute_hidden;
-libc_ifunc (__sqrtf,
- (hwcap & PPC_FEATURE_POWER5)
- ? __sqrtf_power5
- : __sqrtf_ppc32);
+libc_ifunc (__cosf,
+ (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+ ? __cosf_power8
+ : __cosf_ppc64);
-weak_alias (__sqrtf, sqrtf)
+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/powerpc32/power4/fpu/multiarch/w_sqrt-power5.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llroundf-ppc64.S
index b16e78bc41..1af420a1d9 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/w_sqrt-power5.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llroundf-ppc64.S
@@ -1,5 +1,5 @@
-/* sqrt function. PowerPC32/POWER5 version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+/* 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
@@ -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)
@@ -26,6 +25,7 @@
#undef compat_symbol
#define compat_symbol(a,b,c,d)
-#define __sqrt __sqrt_power5
+#define __llroundf __llroundf_ppc64
+#define __lroundf __lroundf_ppc64
-#include <sysdeps/powerpc/powerpc32/power5/fpu/w_sqrt.S>
+#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/powerpc32/power4/fpu/multiarch/w_sqrt.c b/sysdeps/powerpc/powerpc64/multiarch/strcspn.c
index 7569800196..308aab5970 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/w_sqrt.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcspn.c
@@ -1,5 +1,5 @@
-/* Multiple versions of sqrt.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+/* 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
@@ -16,25 +16,20 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <math.h>
-#include <math_ldbl_opt.h>
+#include <string.h>
#include <shlib-compat.h>
#include "init-arch.h"
-extern __typeof (__sqrt) __sqrt_ppc32 attribute_hidden;
-extern __typeof (__sqrt) __sqrt_power5 attribute_hidden;
+#undef strcspn
+extern __typeof (strcspn) __libc_strcspn;
-libc_ifunc (__sqrt,
- (hwcap & PPC_FEATURE_POWER5)
- ? __sqrt_power5
- : __sqrt_ppc32);
+extern __typeof (strcspn) __strcspn_ppc attribute_hidden;
+extern __typeof (strcspn) __strcspn_power8 attribute_hidden;
-weak_alias (__sqrt, sqrt)
+libc_ifunc (__libc_strcspn,
+ (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+ ? __strcspn_power8
+ : __strcspn_ppc);
-#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
+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/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/powerpc32/power4/fpu/multiarch/w_sqrt-ppc32.S b/sysdeps/powerpc/powerpc64/power8/strcasestr-ppc64.c
index 7bf32aa1f3..221d4733f4 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/w_sqrt-ppc32.S
+++ b/sysdeps/powerpc/powerpc64/power8/strcasestr-ppc64.c
@@ -1,5 +1,5 @@
-/* sqrt function. PowerPC32 default version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+/* 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
@@ -16,16 +16,14 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-#include <math_ldbl_opt.h>
+#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)
-#undef strong_alias
-#define strong_alias(a,b)
-#undef compat_symbol
-#define compat_symbol(a,b,c,d)
-
-#define __sqrt __sqrt_ppc32
+extern __typeof (strcasestr) __strcasestr_ppc attribute_hidden;
-#include <sysdeps/powerpc/powerpc32/power4/fpu/w_sqrt.S>
+#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/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/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>