summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libc/ChangeLog970
-rw-r--r--libc/Makefile6
-rw-r--r--libc/Makerules8
-rw-r--r--libc/NEWS12
-rw-r--r--libc/NOTES223
-rw-r--r--libc/README4
-rw-r--r--libc/aclocal.m420
-rw-r--r--libc/config.h.in3
-rw-r--r--libc/config.make.in1
-rwxr-xr-xlibc/configure45
-rw-r--r--libc/configure.in31
-rw-r--r--libc/conform/conformtest.pl11
-rw-r--r--libc/conform/run-conformtest.sh5
-rw-r--r--libc/debug/backtracesymsfd.c2
-rw-r--r--libc/debug/segfault.c2
-rw-r--r--libc/elf/cache.c4
-rw-r--r--libc/elf/dl-cache.c2
-rw-r--r--libc/elf/dl-minimal.c2
-rw-r--r--libc/elf/dl-misc.c2
-rw-r--r--libc/elf/dl-sysdep.c2
-rw-r--r--libc/elf/dl-version.c2
-rw-r--r--libc/elf/rtld.c2
-rw-r--r--libc/elf/sotruss-lib.c58
-rw-r--r--libc/hurd/hurdsock.c2
-rw-r--r--libc/hurd/lookup-retry.c2
-rw-r--r--libc/malloc/malloc.c2
-rw-r--r--libc/malloc/mtrace.c2
-rw-r--r--libc/manual/creature.texi1
-rw-r--r--libc/manual/intro.texi1
-rw-r--r--libc/manual/lang.texi66
-rw-r--r--libc/manual/llio.texi2
-rwxr-xr-xlibc/math/gen-libm-test.pl4
-rw-r--r--libc/math/libm-test.inc435
-rw-r--r--libc/math/s_clog.c27
-rw-r--r--libc/math/s_clog10.c28
-rw-r--r--libc/math/s_clog10f.c28
-rw-r--r--libc/math/s_clog10l.c28
-rw-r--r--libc/math/s_clogf.c28
-rw-r--r--libc/math/s_clogl.c27
-rw-r--r--libc/math/s_csqrt.c26
-rw-r--r--libc/math/s_csqrtf.c26
-rw-r--r--libc/math/s_csqrtl.c26
-rw-r--r--libc/math/w_exp2.c14
-rw-r--r--libc/math/w_exp2f.c14
-rw-r--r--libc/math/w_exp2l.c15
-rw-r--r--libc/math/w_j0.c4
-rw-r--r--libc/math/w_j0f.c4
-rw-r--r--libc/math/w_j0l.c4
-rw-r--r--libc/math/w_j1.c4
-rw-r--r--libc/math/w_j1f.c4
-rw-r--r--libc/math/w_j1l.c4
-rw-r--r--libc/math/w_jn.c4
-rw-r--r--libc/math/w_jnf.c4
-rw-r--r--libc/math/w_jnl.c7
-rw-r--r--libc/nptl/ChangeLog28
-rw-r--r--libc/nptl/sysdeps/unix/sysv/linux/libc-lowlevellock.c2
-rw-r--r--libc/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h2
-rw-r--r--libc/nptl/sysdeps/x86_64/pthreaddef.h2
-rw-r--r--libc/nptl/unwind.c2
-rw-r--r--libc/nscd/nscd_getgr_r.c2
-rw-r--r--libc/nscd/nscd_getpw_r.c2
-rw-r--r--libc/nscd/nscd_getserv_r.c2
-rw-r--r--libc/nss/nss_db/db-init.c4
-rw-r--r--libc/posix/getopt_init.c2
-rw-r--r--libc/posix/wordexp.c2
-rw-r--r--libc/stdio-common/_itoa.c2
-rw-r--r--libc/stdio-common/_itowa.c2
-rw-r--r--libc/stdio-common/printf_fphex.c4
-rw-r--r--libc/stdio-common/vfprintf.c4
-rw-r--r--libc/string/_strerror.c2
-rw-r--r--libc/sysdeps/generic/_itoa.h (renamed from libc/stdio-common/_itoa.h)0
-rw-r--r--libc/sysdeps/generic/dl-osinfo.h4
-rw-r--r--libc/sysdeps/generic/elf/backtracesymsfd.c2
-rw-r--r--libc/sysdeps/generic/ldconfig.h1
-rw-r--r--libc/sysdeps/generic/math_private.h232
-rwxr-xr-xlibc/sysdeps/i386/configure18
-rw-r--r--libc/sysdeps/i386/configure.in48
-rw-r--r--libc/sysdeps/i386/fpu/branred.c1
-rw-r--r--libc/sysdeps/i386/fpu/dosincos.c1
-rw-r--r--libc/sysdeps/i386/fpu/e_pow.S47
-rw-r--r--libc/sysdeps/i386/fpu/e_powf.S47
-rw-r--r--libc/sysdeps/i386/fpu/e_powl.S41
-rw-r--r--libc/sysdeps/i386/fpu/e_rem_pio2f.c3
-rw-r--r--libc/sysdeps/i386/fpu/e_rem_pio2l.c3
-rw-r--r--libc/sysdeps/i386/fpu/feholdexcpt.c19
-rw-r--r--libc/sysdeps/i386/fpu/fenv_private.h304
-rw-r--r--libc/sysdeps/i386/fpu/k_rem_pio2.c3
-rw-r--r--libc/sysdeps/i386/fpu/k_rem_pio2f.c3
-rw-r--r--libc/sysdeps/i386/fpu/libm-test-ulps357
-rw-r--r--libc/sysdeps/i386/fpu/math_private.h17
-rw-r--r--libc/sysdeps/i386/fpu/mpa.c1
-rw-r--r--libc/sysdeps/i386/fpu/mptan.c1
-rw-r--r--libc/sysdeps/i386/fpu/s_cexp.S253
-rw-r--r--libc/sysdeps/i386/fpu/s_cexpf.S257
-rw-r--r--libc/sysdeps/i386/fpu/s_cexpl.S256
-rw-r--r--libc/sysdeps/i386/fpu/s_cos.S54
-rw-r--r--libc/sysdeps/i386/fpu/s_cosf.S54
-rw-r--r--libc/sysdeps/i386/fpu/s_cosl.S54
-rw-r--r--libc/sysdeps/i386/fpu/s_sin.S54
-rw-r--r--libc/sysdeps/i386/fpu/s_sincos.S64
-rw-r--r--libc/sysdeps/i386/fpu/s_sincosf.S64
-rw-r--r--libc/sysdeps/i386/fpu/s_sincosl.S64
-rw-r--r--libc/sysdeps/i386/fpu/s_sinf.S54
-rw-r--r--libc/sysdeps/i386/fpu/s_sinl.S54
-rw-r--r--libc/sysdeps/i386/fpu/s_tan.S55
-rw-r--r--libc/sysdeps/i386/fpu/s_tanf.S55
-rw-r--r--libc/sysdeps/i386/fpu/s_tanl.S55
-rw-r--r--libc/sysdeps/i386/fpu/sincos32.c1
-rw-r--r--libc/sysdeps/i386/i686/hp-timing.h2
-rw-r--r--libc/sysdeps/ieee754/dbl-64/e_atan2.c9
-rw-r--r--libc/sysdeps/ieee754/dbl-64/e_exp.c4
-rw-r--r--libc/sysdeps/ieee754/dbl-64/e_exp2.c97
-rw-r--r--libc/sysdeps/ieee754/dbl-64/e_pow.c6
-rw-r--r--libc/sysdeps/ieee754/dbl-64/k_rem_pio2.c17
-rw-r--r--libc/sysdeps/ieee754/dbl-64/s_fma.c25
-rw-r--r--libc/sysdeps/ieee754/dbl-64/s_fmaf.c12
-rw-r--r--libc/sysdeps/ieee754/dbl-64/s_nearbyint.c33
-rw-r--r--libc/sysdeps/ieee754/dbl-64/s_rint.c33
-rw-r--r--libc/sysdeps/ieee754/dbl-64/s_sin.c10
-rw-r--r--libc/sysdeps/ieee754/dbl-64/s_tan.c4
-rw-r--r--libc/sysdeps/ieee754/dbl-64/wordsize-64/math_private.h35
-rw-r--r--libc/sysdeps/ieee754/dbl-64/wordsize-64/s_llround.c80
-rw-r--r--libc/sysdeps/ieee754/dbl-64/wordsize-64/s_lround.c80
-rw-r--r--libc/sysdeps/ieee754/dbl-64/wordsize-64/s_nearbyint.c12
-rw-r--r--libc/sysdeps/ieee754/dbl-64/wordsize-64/s_rint.c12
-rw-r--r--libc/sysdeps/ieee754/flt-32/e_exp2f.c89
-rw-r--r--libc/sysdeps/ieee754/flt-32/e_expf.c49
-rw-r--r--libc/sysdeps/ieee754/flt-32/e_hypotf.c77
-rw-r--r--libc/sysdeps/ieee754/flt-32/math_private.h35
-rw-r--r--libc/sysdeps/ieee754/ldbl-128/s_expm1l.c5
-rw-r--r--libc/sysdeps/ieee754/ldbl-96/e_rem_pio2l.c236
-rw-r--r--libc/sysdeps/ieee754/ldbl-96/k_cosl.c123
-rw-r--r--libc/sysdeps/ieee754/ldbl-96/k_sinl.c126
-rw-r--r--libc/sysdeps/ieee754/ldbl-96/k_tanl.c137
-rw-r--r--libc/sysdeps/ieee754/ldbl-96/s_cosl.c2
-rw-r--r--libc/sysdeps/ieee754/ldbl-96/s_sinl.c2
-rw-r--r--libc/sysdeps/ieee754/ldbl-96/s_tanl.c11
-rw-r--r--libc/sysdeps/ieee754/ldbl-96/t_sincosl.c483
-rw-r--r--libc/sysdeps/mach/_strerror.c2
-rw-r--r--libc/sysdeps/mach/hurd/powerpc/register-dump.h2
-rw-r--r--libc/sysdeps/mach/hurd/sethostid.c2
-rw-r--r--libc/sysdeps/mach/hurd/xmknodat.c2
-rw-r--r--libc/sysdeps/mach/xpg-strerror.c2
-rw-r--r--libc/sysdeps/powerpc/fpu/e_hypotf.c44
-rw-r--r--libc/sysdeps/powerpc/fpu/libm-test-ulps460
-rw-r--r--libc/sysdeps/powerpc/powerpc32/dl-machine.c2
-rw-r--r--libc/sysdeps/powerpc/powerpc32/power4/hp-timing.h2
-rw-r--r--libc/sysdeps/powerpc/powerpc32/register-dump.h2
-rw-r--r--libc/sysdeps/powerpc/powerpc64/dl-machine.c2
-rw-r--r--libc/sysdeps/powerpc/powerpc64/hp-timing.h2
-rw-r--r--libc/sysdeps/powerpc/powerpc64/register-dump.h2
-rw-r--r--libc/sysdeps/sparc/Makefile2
-rw-r--r--libc/sysdeps/sparc/configure124
-rw-r--r--libc/sysdeps/sparc/configure.in30
-rw-r--r--libc/sysdeps/sparc/elf/rtld-global-offsets.sym7
-rw-r--r--libc/sysdeps/sparc/fpu/fenv_private.h106
-rw-r--r--libc/sysdeps/sparc/fpu/libm-test-ulps704
-rw-r--r--libc/sysdeps/sparc/fpu/math_private.h7
-rw-r--r--libc/sysdeps/sparc/sparc-ifunc.h112
-rw-r--r--libc/sysdeps/sparc/sparc32/dl-machine.h6
-rw-r--r--libc/sysdeps/sparc/sparc32/dl-trampoline.S58
-rw-r--r--libc/sysdeps/sparc/sparc32/fpu/s_fma.c2
-rw-r--r--libc/sysdeps/sparc/sparc32/sparcv9/Makefile9
-rw-r--r--libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/Makefile11
-rw-r--r--libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceil-vis3.S78
-rw-r--r--libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceil.S12
-rw-r--r--libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceilf-vis3.S74
-rw-r--r--libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceilf.S12
-rw-r--r--libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysign-vis3.S30
-rw-r--r--libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysign.S12
-rw-r--r--libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysignf-vis3.S29
-rw-r--r--libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysignf.S12
-rw-r--r--libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabs-vis3.S26
-rw-r--r--libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabs.S12
-rw-r--r--libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabsf-vis3.S26
-rw-r--r--libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabsf.S12
-rw-r--r--libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floor-vis3.S79
-rw-r--r--libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floor.S12
-rw-r--r--libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floorf-vis3.S74
-rw-r--r--libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floorf.S12
-rw-r--r--libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fma-vis3.S31
-rw-r--r--libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fma.c14
-rw-r--r--libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmaf-vis3.S28
-rw-r--r--libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmaf.c14
-rw-r--r--libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmax-vis3.S30
-rw-r--r--libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmax.S12
-rw-r--r--libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmaxf-vis3.S28
-rw-r--r--libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmaxf.S12
-rw-r--r--libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmin-vis3.S30
-rw-r--r--libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmin.S12
-rw-r--r--libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fminf-vis3.S28
-rw-r--r--libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fminf.S12
-rw-r--r--libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrint-vis3.S58
-rw-r--r--libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrint.S17
-rw-r--r--libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrintf-vis3.S54
-rw-r--r--libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrintf.S17
-rw-r--r--libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rint-vis3.S55
-rw-r--r--libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rint.S12
-rw-r--r--libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rintf-vis3.S51
-rw-r--r--libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rintf.S12
-rw-r--r--libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/w_sqrt-vis3.S49
-rw-r--r--libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/w_sqrt.S12
-rw-r--r--libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/w_sqrtf-vis3.S47
-rw-r--r--libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/w_sqrtf.S12
-rw-r--r--libc/sysdeps/sparc/sparc32/sparcv9/fpu/s_fmax.S (renamed from libc/sysdeps/x86_64/fpu/s_sincosl.S)67
-rw-r--r--libc/sysdeps/sparc/sparc32/sparcv9/fpu/s_fmaxf.S40
-rw-r--r--libc/sysdeps/sparc/sparc32/sparcv9/fpu/s_fmin.S40
-rw-r--r--libc/sysdeps/sparc/sparc32/sparcv9/fpu/s_fminf.S40
-rw-r--r--libc/sysdeps/sparc/sparc32/sparcv9/fpu/unix/sysv/linux/multiarch/Implies4
-rw-r--r--libc/sysdeps/sparc/sparc32/sparcv9/hp-timing.h2
-rw-r--r--libc/sysdeps/sparc/sparc64/Makefile9
-rw-r--r--libc/sysdeps/sparc/sparc64/dl-trampoline.S43
-rw-r--r--libc/sysdeps/sparc/sparc64/fpu/multiarch/Makefile15
-rw-r--r--libc/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil-vis3.S75
-rw-r--r--libc/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil.S12
-rw-r--r--libc/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf-vis3.S73
-rw-r--r--libc/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf.S12
-rw-r--r--libc/sysdeps/sparc/sparc64/fpu/multiarch/s_finite-vis3.S28
-rw-r--r--libc/sysdeps/sparc/sparc64/fpu/multiarch/s_finite.S15
-rw-r--r--libc/sysdeps/sparc/sparc64/fpu/multiarch/s_finitef-vis3.S28
-rw-r--r--libc/sysdeps/sparc/sparc64/fpu/multiarch/s_finitef.S15
-rw-r--r--libc/sysdeps/sparc/sparc64/fpu/multiarch/s_floor-vis3.S75
-rw-r--r--libc/sysdeps/sparc/sparc64/fpu/multiarch/s_floor.S12
-rw-r--r--libc/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf-vis3.S73
-rw-r--r--libc/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf.S12
-rw-r--r--libc/sysdeps/sparc/sparc64/fpu/multiarch/s_fma-vis3.S25
-rw-r--r--libc/sysdeps/sparc/sparc64/fpu/multiarch/s_fma.c14
-rw-r--r--libc/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaf-vis3.S25
-rw-r--r--libc/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaf.c14
-rw-r--r--libc/sysdeps/sparc/sparc64/fpu/multiarch/s_fmax-vis3.S26
-rw-r--r--libc/sysdeps/sparc/sparc64/fpu/multiarch/s_fmax.S12
-rw-r--r--libc/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaxf-vis3.S27
-rw-r--r--libc/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaxf.S12
-rw-r--r--libc/sysdeps/sparc/sparc64/fpu/multiarch/s_fmin-vis3.S26
-rw-r--r--libc/sysdeps/sparc/sparc64/fpu/multiarch/s_fmin.S12
-rw-r--r--libc/sysdeps/sparc/sparc64/fpu/multiarch/s_fminf-vis3.S27
-rw-r--r--libc/sysdeps/sparc/sparc64/fpu/multiarch/s_fminf.S12
-rw-r--r--libc/sysdeps/sparc/sparc64/fpu/multiarch/s_isinf-vis3.S31
-rw-r--r--libc/sysdeps/sparc/sparc64/fpu/multiarch/s_isinf.S15
-rw-r--r--libc/sysdeps/sparc/sparc64/fpu/multiarch/s_isinff-vis3.S30
-rw-r--r--libc/sysdeps/sparc/sparc64/fpu/multiarch/s_isinff.S15
-rw-r--r--libc/sysdeps/sparc/sparc64/fpu/multiarch/s_isnan-vis3.S30
-rw-r--r--libc/sysdeps/sparc/sparc64/fpu/multiarch/s_isnan.S15
-rw-r--r--libc/sysdeps/sparc/sparc64/fpu/multiarch/s_isnanf-vis3.S29
-rw-r--r--libc/sysdeps/sparc/sparc64/fpu/multiarch/s_isnanf.S15
-rw-r--r--libc/sysdeps/sparc/sparc64/fpu/multiarch/s_lrint-vis3.S52
-rw-r--r--libc/sysdeps/sparc/sparc64/fpu/multiarch/s_lrint.S17
-rw-r--r--libc/sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf-vis3.S51
-rw-r--r--libc/sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf.S17
-rw-r--r--libc/sysdeps/sparc/sparc64/fpu/multiarch/s_rint-vis3.S50
-rw-r--r--libc/sysdeps/sparc/sparc64/fpu/multiarch/s_rint.S12
-rw-r--r--libc/sysdeps/sparc/sparc64/fpu/multiarch/s_rintf-vis3.S49
-rw-r--r--libc/sysdeps/sparc/sparc64/fpu/multiarch/s_rintf.S12
-rw-r--r--libc/sysdeps/sparc/sparc64/fpu/multiarch/s_signbit-vis3.S25
-rw-r--r--libc/sysdeps/sparc/sparc64/fpu/multiarch/s_signbit.S23
-rw-r--r--libc/sysdeps/sparc/sparc64/fpu/multiarch/s_signbitf-vis3.S25
-rw-r--r--libc/sysdeps/sparc/sparc64/fpu/multiarch/s_signbitf.S12
-rw-r--r--libc/sysdeps/sparc/sparc64/fpu/s_copysign.S5
-rw-r--r--libc/sysdeps/sparc/sparc64/fpu/s_copysignf.S5
-rw-r--r--libc/sysdeps/sparc/sparc64/fpu/s_fma.c2
-rw-r--r--libc/sysdeps/sparc/sparc64/fpu/s_fmax.S36
-rw-r--r--libc/sysdeps/sparc/sparc64/fpu/s_fmaxf.S36
-rw-r--r--libc/sysdeps/sparc/sparc64/fpu/s_fmin.S36
-rw-r--r--libc/sysdeps/sparc/sparc64/fpu/s_fminf.S36
-rw-r--r--libc/sysdeps/sparc/sparc64/hp-timing.h2
-rw-r--r--libc/sysdeps/sparc/sparc64/multiarch/memcpy.S1
-rw-r--r--libc/sysdeps/sparc/sparc64/multiarch/memset.S1
-rw-r--r--libc/sysdeps/unix/Makefile240
-rw-r--r--libc/sysdeps/unix/errnos-tmpl.c98
-rw-r--r--libc/sysdeps/unix/errnos.awk12
-rw-r--r--libc/sysdeps/unix/ioctls-tmpl.c134
-rw-r--r--libc/sysdeps/unix/ioctls.awk10
-rw-r--r--libc/sysdeps/unix/mk-local_lim.c125
-rwxr-xr-xlibc/sysdeps/unix/snarf-ioctls48
-rw-r--r--libc/sysdeps/unix/sysv/linux/Makefile17
-rw-r--r--libc/sysdeps/unix/sysv/linux/configure2
-rw-r--r--libc/sysdeps/unix/sysv/linux/configure.in2
-rw-r--r--libc/sysdeps/unix/sysv/linux/dl-osinfo.h4
-rw-r--r--libc/sysdeps/unix/sysv/linux/fd_to_filename.h2
-rw-r--r--libc/sysdeps/unix/sysv/linux/futimes.c2
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/readelflib.c66
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/register-dump.h2
-rw-r--r--libc/sysdeps/unix/sysv/linux/kernel-features.h19
-rw-r--r--libc/sysdeps/unix/sysv/linux/openat.c2
-rw-r--r--libc/sysdeps/unix/sysv/linux/ptsname.c2
-rw-r--r--libc/sysdeps/unix/sysv/linux/s390/s390-32/register-dump.h2
-rw-r--r--libc/sysdeps/unix/sysv/linux/s390/s390-64/register-dump.h2
-rw-r--r--libc/sysdeps/unix/sysv/linux/sh/sh3/register-dump.h2
-rw-r--r--libc/sysdeps/unix/sysv/linux/sh/sh4/register-dump.h2
-rw-r--r--libc/sysdeps/unix/sysv/linux/shmat.c22
-rw-r--r--libc/sysdeps/unix/sysv/linux/sparc/Makefile4
-rw-r--r--libc/sysdeps/unix/sysv/linux/sparc/Versions2
-rw-r--r--libc/sysdeps/unix/sysv/linux/sparc/bits/shm.h4
-rw-r--r--libc/sysdeps/unix/sysv/linux/sparc/getshmlba.c40
-rw-r--r--libc/sysdeps/unix/sysv/linux/sparc/sparc32/register-dump.h2
-rw-r--r--libc/sysdeps/unix/sysv/linux/sparc/sparc64/dl-fxstatat64.c6
-rw-r--r--libc/sysdeps/unix/sysv/linux/sparc/sparc64/makecontext.c4
-rw-r--r--libc/sysdeps/unix/sysv/linux/sparc/sparc64/register-dump.h2
-rw-r--r--libc/sysdeps/unix/sysv/linux/sparc/sysdep.h6
-rw-r--r--libc/sysdeps/unix/sysv/linux/ttyname.c2
-rw-r--r--libc/sysdeps/unix/sysv/linux/ttyname_r.c2
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/dl-cache.h29
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/ldconfig.h1
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/ldd-rewrite.sed2
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/makecontext.c33
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/readelflib.c63
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/register-dump.h2
-rw-r--r--libc/sysdeps/x86_64/bits/atomic.h14
-rw-r--r--libc/sysdeps/x86_64/bits/mathdef.h6
-rw-r--r--libc/sysdeps/x86_64/bits/setjmp.h2
-rw-r--r--libc/sysdeps/x86_64/elf/start.S7
-rw-r--r--libc/sysdeps/x86_64/ffsll.c4
-rw-r--r--libc/sysdeps/x86_64/fpu/bits/fenv.h5
-rw-r--r--libc/sysdeps/x86_64/fpu/bits/mathinline.h8
-rw-r--r--libc/sysdeps/x86_64/fpu/e_powl.S41
-rw-r--r--libc/sysdeps/x86_64/fpu/e_rem_pio2l.c3
-rw-r--r--libc/sysdeps/x86_64/fpu/feholdexcpt.c21
-rw-r--r--libc/sysdeps/x86_64/fpu/k_cosl.c1
-rw-r--r--libc/sysdeps/x86_64/fpu/k_sinl.c1
-rw-r--r--libc/sysdeps/x86_64/fpu/k_tanl.c1
-rw-r--r--libc/sysdeps/x86_64/fpu/libm-test-ulps247
-rw-r--r--libc/sysdeps/x86_64/fpu/math_private.h109
-rw-r--r--libc/sysdeps/x86_64/fpu/s_cosl.S42
-rw-r--r--libc/sysdeps/x86_64/fpu/s_sincos.S60
-rw-r--r--libc/sysdeps/x86_64/fpu/s_sinl.S42
-rw-r--r--libc/sysdeps/x86_64/fpu/s_tanl.S45
-rw-r--r--libc/sysdeps/x86_64/jmpbuf-unwind.h4
-rw-r--r--libc/time/offtime.c4
-rw-r--r--libc/timezone/Makefile5
-rw-r--r--ports/ChangeLog.alpha14
-rw-r--r--ports/ChangeLog.arm5
-rw-r--r--ports/ChangeLog.m68k20
-rw-r--r--ports/ChangeLog.mips11
-rw-r--r--ports/sysdeps/alpha/fpu/math_private.h21
-rw-r--r--ports/sysdeps/alpha/hp-timing.h2
-rw-r--r--ports/sysdeps/m68k/m680x0/fpu/libm-test-ulps370
-rw-r--r--ports/sysdeps/mips/mips64/gmp-mparam.h3
-rw-r--r--ports/sysdeps/unix/sysv/linux/alpha/bits/socket.h437
-rw-r--r--ports/sysdeps/unix/sysv/linux/alpha/bits/socket_type.h55
-rw-r--r--ports/sysdeps/unix/sysv/linux/arm/register-dump.h4
-rw-r--r--ports/sysdeps/unix/sysv/linux/m68k/kernel-features.h12
-rw-r--r--ports/sysdeps/unix/sysv/linux/m68k/register-dump.h4
-rw-r--r--ports/sysdeps/unix/sysv/linux/mips/register-dump.h4
343 files changed, 9477 insertions, 4419 deletions
diff --git a/libc/ChangeLog b/libc/ChangeLog
index dbc58e6c0..b7ba9f57f 100644
--- a/libc/ChangeLog
+++ b/libc/ChangeLog
@@ -1,3 +1,973 @@
+2012-03-21 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/unix/sysv/linux/configure.in: Check x86_64* instead
+ of x86_64 when setting libc_cv_slibdir, libdir and
+ libc_cv_localedir.
+ * sysdeps/unix/sysv/linux/configure: Regenerated.
+
+2012-03-21 Joseph Myers <joseph@codesourcery.com>
+
+ * manual/lang.texi (Old Varargs): Remove section.
+ (How Variadic): Update menu.
+ (va_start): Do not mention varargs.h.
+
+2012-03-21 Thomas Schwinge <thomas@codesourcery.com>
+ Joseph Myers <joseph@codesourcery.com>
+
+ * configure.in (libc_cv_ssp): Use LIBC_TRY_CC_OPTION instead of a
+ link test.
+ * configure: Regenerated.
+
+2012-03-21 Thomas Schwinge <thomas@codesourcery.com>
+
+ * conform/conformtest.pl: Handle --tmpdir argument, defaulting to /tmp.
+ * conform/run-conformtest.sh: Pass --tmpdir argument when invoking
+ conformtest.pl
+
+2012-03-21 Joseph Myers <joseph@codesourcery.com>
+
+ * NOTES: Remove.
+ * Makefile (files-for-dist): Remove NOTES.
+ (NOTES): Remove rule.
+ * README: Don't refer to NOTES.
+ * manual/creature.texi: Don't include macros.texi.
+ * manual/intro.texi (creature.texi): Remove comment referring to
+ NOTES.
+
+ * aclocal.m4 (LIBC_TRY_CC_OPTION): New macro.
+ * configure.in (libc_cv_cc_submachine): Use LIBC_TRY_CC_OPTION.
+ * configure: Regenerated.
+ * sysdeps/i386/configure.in (libc_cv_cc_sse4): Use
+ LIBC_TRY_CC_OPTION.
+ (libc_cv_as_i686): Likewise.
+ (libc_cv_cc_avx): Likewise.
+ (libc_cv_cc_sse2avx): Likewise.
+ (libc_cv_cc_fma4): Likewise.
+ (libc_cv_cc_novzeroupper): Likewise.
+ * sysdeps/i386/configure: Regenerated.
+
+ [BZ #13883]
+ * sysdeps/i386/fpu/s_cexp.S: Remove.
+ * sysdeps/i386/fpu/s_cexpf.S: Likewise.
+ * sysdeps/i386/fpu/s_cexpl.S: Likewise.
+ * math/libm-test.inc (cexp_test): Add more tests.
+ * sysdeps/i386/fpu/libm-test-ulps: Update.
+ * sysdeps/x86_64/fpu/libm-test-ulps: Likewise.
+
+2012-03-21 Allan McRae <allan@archlinux.org>
+
+ * timezone/Makefile: Do not install iso3166.tab and zone.tab
+
+2012-03-21 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #13871]
+ * math/w_exp2.c: Do not include <float.h>.
+ (o_threshold, u_threshold): Remove.
+ (__exp2): Calculate result before checking finiteness and calling
+ __kernel_standard.
+ * math/w_exp2f.c: Likewise.
+ * math/w_exp2l.c: Likewise.
+ * math/libm-test.inc (exp2_test): Require overflow exception for
+ 1e6 input.
+
+ [BZ #3866]
+ * sysdeps/i386/fpu/e_pow.S (__ieee754_pow): Test for y outside the
+ range of signed 64-bit integers before using fistpll. Remove
+ checks for whether integers fit in mantissa bits.
+ * sysdeps/i386/fpu/e_powf.S (__ieee754_powf): Test for y outside
+ the range of signed 32-bit integers before using fistpl. Remove
+ checks for whether integers fit in mantissa bits.
+ * sysdeps/i386/fpu/e_powl.S (p64): New object.
+ (__ieee754_powl): Test for y outside the range of signed 64-bit
+ integers before using fistpll. Reduce 64-bit values to 63-bit
+ ones as needed.
+ * sysdeps/ieee754/dbl-64/e_pow.c (__ieee754_pow): Ensure
+ divide-by-zero is raised for zero to large negative powers.
+ * sysdeps/x86_64/fpu/e_powl.S (p64): New object.
+ (__ieee754_powl): Test for y outside the range of signed 64-bit
+ integers before using fistpll. Reduce 64-bit values to 63-bit
+ ones as needed.
+ * math/libm-test.inc (pow_test): Add more tests.
+
+2012-03-20 H.J. Lu <hongjiu.lu@intel.com>
+
+ * debug/backtracesymsfd.c: Include <_itoa.h> instead of
+ <stdio-common/_itoa.h>.
+ * debug/segfault.c: Likewise.
+ * elf/dl-cache.c: Likewise.
+ * elf/dl-minimal.c: Likewise.
+ * elf/dl-misc.c: Likewise.
+ * elf/dl-sysdep.c: Likewise.
+ * elf/dl-version.c: Likewise.
+ * elf/rtld.c: Likewise.
+ * hurd/hurdsock.c: Likewise.
+ * hurd/lookup-retry.c: Likewise.
+ * malloc/malloc.c: Likewise.
+ * malloc/mtrace.c: Likewise.
+ * nscd/nscd_getgr_r.c: Likewise.
+ * nscd/nscd_getpw_r.c: Likewise.
+ * nscd/nscd_getserv_r.c: Likewise.
+ * posix/getopt_init.c: Likewise.
+ * posix/wordexp.c: Likewise.
+ * stdio-common/_itoa.c: Likewise.
+ * stdio-common/printf_fphex.c: Likewise.
+ * stdio-common/vfprintf.c: Likewise.
+ * string/_strerror.c: Likewise.
+ * sysdeps/generic/elf/backtracesymsfd.c: Likewise.
+ * sysdeps/i386/i686/hp-timing.h: Likewise.
+ * sysdeps/mach/_strerror.c: Likewise.
+ * sysdeps/mach/hurd/powerpc/register-dump.h: Likewise.
+ * sysdeps/mach/hurd/sethostid.c: Likewise.
+ * sysdeps/mach/hurd/xmknodat.c: Likewise.
+ * sysdeps/mach/xpg-strerror.c: Likewise.
+ * sysdeps/powerpc/powerpc32/dl-machine.c: Likewise.
+ * sysdeps/powerpc/powerpc32/power4/hp-timing.h: Likewise.
+ * sysdeps/powerpc/powerpc32/register-dump.h: Likewise.
+ * sysdeps/powerpc/powerpc64/dl-machine.c: Likewise.
+ * sysdeps/powerpc/powerpc64/hp-timing.h: Likewise.
+ * sysdeps/powerpc/powerpc64/register-dump.h: Likewise.
+ * sysdeps/sparc/sparc32/sparcv9/hp-timing.h: Likewise.
+ * sysdeps/sparc/sparc64/hp-timing.h: Likewise.
+ * sysdeps/unix/sysv/linux/fd_to_filename.h: Likewise.
+ * sysdeps/unix/sysv/linux/futimes.c: Likewise.
+ * sysdeps/unix/sysv/linux/i386/register-dump.h: Likewise.
+ * sysdeps/unix/sysv/linux/ptsname.c: Likewise.
+ * sysdeps/unix/sysv/linux/s390/s390-32/register-dump.h: Likewise.
+ * sysdeps/unix/sysv/linux/s390/s390-64/register-dump.h: Likewise.
+ * sysdeps/unix/sysv/linux/sh/sh3/register-dump.h: Likewise.
+ * sysdeps/unix/sysv/linux/sh/sh4/register-dump.h: Likewise.
+ * sysdeps/unix/sysv/linux/sparc/sparc32/register-dump.h: Likewise.
+ * sysdeps/unix/sysv/linux/sparc/sparc64/register-dump.h: Likewise.
+ * sysdeps/unix/sysv/linux/ttyname.c: Likewise.
+ * sysdeps/unix/sysv/linux/ttyname_r.c: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/register-dump.h: Likewise.
+
+ * stdio-common/_itoa.c: Include <_itoa.h> instead of "_itoa.h".
+
+ * stdio-common/_itoa.h: Moved to ...
+ * sysdeps/generic/_itoa.h: Here.
+
+ * stdio-common/_itowa.c: Include <_itowa.h> instead of "_itowa.h".
+
+ * stdio-common/printf_fphex.c: Include <_itoa.h> and <_itowa.h>
+ instead of "_itoa.h" and "_itowa.h".
+ * stdio-common/vfprintf.: Likewise.
+
+2012-03-20 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/x86_64/fpu/bits/mathinline.h: Don't include
+ <bits/wordsize.h>.
+ (__signbitf): Check __x86_64__ instead of __WORDSIZE.
+ (__signbit): Likwise.
+ (llrintf): Likwise.
+ (llrint): Likwise.
+
+2012-03-20 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/x86_64/bits/setjmp.h (__jmp_buf): Support x86-64 with
+ __WORDSIZE != 64.
+
+2012-03-20 Joseph Myers <joseph@codesourcery.com>
+
+ * math/gen-libm-test.pl (%beautify): Add OVERFLOW_EXCEPTION and
+ OVERFLOW_EXCEPTION_OK.
+ * math/libm-test.inc ("Philosophy"): Update comment about
+ exception testing.
+ (OVERFLOW_EXCEPTION): Define.
+ (OVERFLOW_EXCEPTION_OK): Likewise.
+ (INVALID_EXCEPTION_OK): Renumber.
+ (DIVIDE_BY_ZERO_EXCEPTION_OK): Likewise.
+ (IGNORE_ZERO_INF_SIGN): Likewise.
+ (test_exceptions): Handle FE_OVERFLOW.
+ (exp10_test): Expect overflow exceptions.
+ (exp2_test): Likewise.
+ (expm1_test): Likewise.
+ (nextafter_test): Likewise.
+ (pow_test): Likewise.
+ (scalbn_test): Likewise.
+ (scalbln_test): Likewise.
+
+2012-03-19 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/x86_64/bits/atomic.h
+ (__arch_c_compare_and_exchange_val_64_acq): Use atomic64_t on
+ 64bit integer.
+ (atomic_exchange_acq): Likewise.
+ (__arch_exchange_and_add_body): Likewise.
+ (__arch_add_body): Likewise.
+ (atomic_add_negative): Likewise.
+ (atomic_add_zero): Likewise.
+
+2012-03-19 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/x86_64/fpu/bits/fenv.h: Don't include <bits/wordsize.h>.
+ (fenv_t): Check __x86_64__ instead of __WORDSIZE.
+
+2012-03-19 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/x86_64/bits/mathdef.h: Don't include <bits/wordsize.h>.
+ Check __x86_64__ instead of __WORDSIZE.
+
+2012-03-19 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/unix/sysv/linux/x86_64/ldd-rewrite.sed: Support x32.
+
+2012-03-19 David S. Miller <davem@davemloft.net>
+
+ * sysdeps/sparc/fpu/libm-test-ulps: Update.
+
+ * sysdeps/sparc/fpu/fenv_private.h: New file.
+ * sysdeps/sparc/fpu/math_private.h: Use it.
+ (libc_feholdexcept, libc_feholdexceptf, libc_feholdexceptl):
+ Remove.
+ (libc_feholdexcept_setround, libc_feholdexcept_setroundf,
+ (libc_feholdexcept_setroundl): Remove.
+ (libc_fetestexcept, libc_fetestexceptf, libc_fetestexceptl):
+ Remove.
+ (libc_fesetenv, libc_fesetenvf, libc_fesetenvl): Remove.
+ (libc_feupdateenv, libc_feupdateenvf, libc_feupdateenvf): Remove.
+
+2012-03-19 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/x86_64/fpu/math_private.h (EXTRACT_WORDS64): Use
+ int64_t instead of long int.
+ (INSERT_WORDS64): Likwise.
+
+2012-03-19 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/x86_64/jmpbuf-unwind.h (_JMPBUF_CFA_UNWINDS_ADJ): Cast
+ _Unwind_GetCFA return to _Unwind_Ptr first.
+
+2012-03-19 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #13629]
+ * math/s_clog.c: Include <float.h>.
+ (__clog): Scale large or subnormal inputs.
+ * math/s_clogf.c: Likewise.
+ * math/s_clogl.c: Likewise.
+ * math/s_clog10.c: Include <float.h>.
+ (M_LOG10_2): Define.
+ (__clog10): Scale large or subnormal inputs.
+ * math/s_clog10f.c: Likewise.
+ * math/s_clog10l.c: Likewise.
+ * math/libm-test.inc (clog_test): Add more tests.
+ (clog10_test): Likewise.
+ * sysdeps/i386/fpu/libm-test-ulps: Update.
+ * sysdeps/x86_64/fpu/libm-test-ulps: Likewise.
+
+ [BZ #11451]
+ * sysdeps/ieee754/dbl-64/e_atan2.c (__ieee754_atan2): Scale large
+ x and y.
+ * math/libm-test.inc (atan2_test): Add another test.
+
+ * Makerules (common-objdir-compile): Remove.
+ * sysdeps/unix/Makefile (config-generated): Do not add
+ $(unix-generated) to variable.
+ [generic bits/local_lim.h] (mk-local_lim-CFLAGS): Remove variable.
+ [generic bits/local_lim.h] ($(common-objpfx)bits/local_lim.h):
+ Remove rule.
+ [generic bits/local_lim.h] ($(common-objpfx)mk-local_lim):
+ Likewise.
+ [generic bits/local_lim.h] (before-compile): Do not append to
+ variable.
+ [generic bits/local_lim.h] (common-generated): Likewise.
+ [generic sys/param.h] (before-compile): Do not append to variable.
+ [generic sys/param.h] ($(common-objpfx)sys/param.h): Remove rule.
+ [generic sys/param.h] ($(common-objpfx)param.h.c): Likewise.
+ [generic sys/param.h] ($(common-objpfx)param.h.dep): Likewise.
+ [generic sys/param.h] ($(common-objpfx)param.h.dep): Do not
+ include.
+ [generic sys/param.h] (sys/param.h-includes): Remove variable.
+ [generic sys/param.h] (sys/param.h-includes): Remove rule.
+ [generic sys/param.h] ($(addprefix
+ $(common-objpfx),$(sys/param.h-includes))): Likewise.
+ [generic sys/param.h] (common-generated): Do not append to
+ variable.
+ [generic sys/param.h] (sysdep_headers): Likewise.
+ [generic bits/errno.h] (before-compile): Do not append to
+ variable.
+ [generic bits/errno.h] ($(common-objpfx)bits/errno.h): Remove
+ rule.
+ [generic bits/errno.h] ($(common-objpfx)make-errnos): Likewise.
+ [generic bits/errno.h] ($(common-objpfx)make-errnos.c): Likewise.
+ [generic bits/errno.h] ($(common-objpfx)errnos): Likewise.
+ [generic bits/errno.h] (common-generated): Do not append to
+ variable.
+ [generic bits/ioctls.h] (before-compile): Do not append to
+ variable.
+ [generic bits/ioctls.h] ($(common-objpfx)bits/ioctls.h): Remove
+ rule.
+ [generic bits/ioctls.h] (ioctl-includes): Remove variable.
+ [generic bits/ioctls.h] (make-ioctls-CFLAGS): Likewise.
+ [generic bits/ioctls.h] ($(common-objpfx)make-ioctls): Remove
+ rule.
+ [generic bits/ioctls.h] ($(common-objpfx)make-ioctls.c): Likewise.
+ [generic bits/ioctls.h] (bits_termios.h): Remove variable.
+ [generic bits/ioctls.h] ($(common-objpfx)ioctls): Remove rule.
+ [generic bits/ioctls.h] (common-generated): Do not append to
+ variable.
+ [generic sys/syscall.h] (syscall.h): Remove variable.
+ [generic sys/syscall.h] ($(common-objpfx)sys/syscall.h): Remove
+ rule.
+ [generic sys/syscall.h] (before-compile): Do not append to
+ variable.
+ [generic sys/syscall.h] (common-generated): Likewise.
+ * sysdeps/unix/errnos-tmpl.c: Remove file.
+ * sysdeps/unix/errnos.awk: Likewise.
+ * sysdeps/unix/ioctls-tmpl.c: Likewise.
+ * sysdeps/unix/ioctls.awk: Likewise.
+ * sysdeps/unix/mk-local_lim.c: Likewise.
+ * sysdeps/unix/snarf-ioctls: Likewise.
+
+2012-03-19 Richard Henderson <rth@twiddle.net>
+
+ * sysdeps/i386/fpu/fenv_private.h: New file.
+ * sysdeps/i386/fpu/math_private.h: Use it.
+ (math_opt_barrier, math_force_eval): Remove.
+ (libc_feholdexcept_setround_53bit): Remove.
+ (libc_feupdateenv_53bit): Remove.
+ * sysdeps/x86_64/fpu/math_private.h: Likewise.
+ (math_opt_barrier, math_force_eval): Remove.
+ (libc_feholdexcept): Remove.
+ (libc_feholdexcept_setround): Remove.
+ (libc_fetestexcept, libc_fesetenv): Remove.
+ (libc_feupdateenv_test): Remove.
+ (libc_feupdateenv, libc_feholdsetround): Remove.
+ (libc_feresetround): Remove.
+
+ * sysdeps/i386/fpu/feholdexcpt.c (feholdexcept): Avoid the fldenv.
+ * sysdeps/x86_64/fpu/feholdexcpt.c (feholdexcept): Likewise.
+
+ * sysdeps/generic/math_private.h (default_libc_feupdateenv_test): New.
+ (libc_feupdateenv_test, libc_feupdateenv_testf): New.
+ (libc_feupdateenv_testl): New.
+ * sysdeps/x86_64/fpu/math_private.h (libc_feupdateenv_test): New.
+ (libc_feupdateenv_testf): New.
+ (libc_feupdateenv): Use libc_feupdateenv_test.
+ * sysdeps/ieee754/dbl-64/s_fma.c (__fma): Use libc_feupdateenv_test.
+ * sysdeps/ieee754/dbl-64/s_fmaf.c (__fmaf): Likewise.
+
+ * sysdeps/generic/math_private.h (libc_feholdsetround): New.
+ (libc_feholdsetroundf, libc_feholdsetroundl): New.
+ (libc_feresetround, libc_feresetroundf, libc_feresetroundl): New.
+ (libc_feresetround_noex): New.
+ (libc_feresetround_noexf): New.
+ (libc_feresetround_noexl): New.
+ (SET_RESTORE_ROUND, SET_RESTORE_ROUNDF, SET_RESTORE_ROUNDL): New.
+ (SET_RESTORE_ROUND_NOEX, SET_RESTORE_ROUND_NOEXF): New.
+ (SET_RESTORE_ROUND_NOEXL, SET_RESTORE_ROUND_53BIT): New.
+ * sysdeps/ieee754/dbl-64/e_exp.c (__ieee754_exp): Use
+ SET_RESTORE_ROUND.
+ * sysdeps/ieee754/dbl-64/e_pow.c (__ieee754_pow): Likewise.
+ * sysdeps/ieee754/dbl-64/s_sin.c (__sin): Use SET_RESTORE_ROUND_53BIT.
+ (__cos): Likewise.
+ * sysdeps/ieee754/dbl-64/s_tan.c (__tan): Likewise.
+ * sysdeps/ieee754/dbl-64/e_exp2.c (__ieee754_exp2): Use
+ SET_RESTORE_ROUND_NOEX.
+ * sysdeps/ieee754/dbl-64/e_exp2f.c (__ieee754_exp2f): Use
+ SET_RESTORE_ROUND_NOEXF.
+ * sysdeps/ieee754/flt-32/e_expf.c (__ieee754_expf): Likewise.
+ * sysdeps/x86_64/fpu/math_private.h (libc_feholdsetround): New.
+ (libc_feholdsetroundf): New.
+ (libc_feresetround, libc_feresetroundf): New.
+
+ * sysdeps/i386/fpu/math_private.h: Include <fenv.h>, <fpu_control.h>.
+ (libc_feholdexcept_setround_53bit): Convert from macro to function.
+ (libc_feupdateenv_53bit): Likewise. Don't force _FPU_EXTENDED.
+
+ * sysdeps/generic/math_private.h: Include <fenv.h>.
+ (default_libc_feholdexcept): New.
+ (default_libc_feholdexcept_setround): New.
+ (default_libc_fesetenv, default_libc_feupdateenv): New.
+ (libc_feholdexcept): Only define if undefined.
+ (libc_feholdexceptf, libc_feholdexceptl): Likewise.
+ (libc_feholdexcept_setround, libc_feholdexcept_setroundf): Likewise.
+ (libc_feholdexcept_setroundl): Likewise.
+ (libc_feholdexcept_setround_53bit): Likewise.
+ (libc_fetestexcept, libc_fetestexceptf, libc_fetestexceptl): Likewise.
+ (libc_fesetenv, libc_fesetenvf, libc_fesetenvl): Likewise.
+ (libc_feupdateenv, libc_feupdateenvf, libc_feupdateenvl): Likewise.
+ (libc_feupdateenv_53bit): Likewise.
+ * sysdeps/x86_64/fpu/math_private.h: Include <fenv.h>.
+ (libc_feholdexcept): Convert from macro to inline function.
+ (libc_feholdexcept_setround, libc_fetestexcept): Likewise.
+ (libc_fesetenv, libc_feupdateenv): Likewise.
+
+ * sysdeps/generic/math_private.h (GET_HIGH_WORD): Define only if
+ not previously defined.
+ (GET_LOW_WORD, EXTRACT_WORDS64, INSERT_WORDS): Likewise.
+ (INSERT_WORDS64, SET_HIGH_WORD, SET_LOW_WORD): Likewise.
+ (GET_FLOAT_WORD, SET_FLOAT_WORD): Likewise.
+ * sysdeps/ieee754/dbl-64/wordsize-64/math_private.h: New file.
+ * sysdeps/ieee754/flt-32/math_private.h: New file.
+ * sysdeps/x86_64/fpu/math_private.h: Move the include_next of
+ math_private.h below SET_FLOAT_WORD.
+ (__isnan, __isinf_ns, __finite): Remove.
+ (__isnanf, __isinf_nsf, __finitef): Remove.
+
+2012-03-18 Andreas Schwab <schwab@linux-m68k.org>
+
+ * sysdeps/powerpc/fpu/libm-test-ulps: Update.
+
+2012-03-17 David S. Miller <davem@davemloft.net>
+
+ [BZ #6471]
+ * sysdeps/unix/sysv/linux/sparc/Versions: Add __getshmlba entry
+ for 2.16.
+
+2012-03-16 David S. Miller <davem@davemloft.net>
+
+ * sysdeps/unix/sysv/linux/shmat.c (shmat): Use -1l to avoid
+ warnings.
+
+ [BZ #6471]
+ * sysdeps/unix/sysv/linux/shmat.c (shmat): Test for syscall errors
+ properly.
+ * sysdeps/unix/sysv/linux/sparc/getshmlba.c: New file.
+ * sysdeps/unix/sysv/linux/sparc/Makefile: Add getshmlba to
+ sysdep_routines when subdir is sysvipc.
+ * sysdeps/unix/sysv/linux/sparc/bits/shm.h (SHMLBA): Use new
+ __getshmlba helper.
+
+ * sysdeps/sparc/fpu/libm-test/ulps: Update.
+
+2012-03-16 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/x86_64/ffsll.c (ffsl): Define alias only under
+ [__LP64__].
+
+2012-03-16 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/ieee754/dbl-64/wordsize-64/s_lround.c: Moved to ...
+ * sysdeps/ieee754/dbl-64/wordsize-64/s_llround.c: This.
+ (__lround): Renamed to ...
+ (__llround): This. Replace long int with long long int.
+ Define lround functions as aliases of llround functions.
+ * sysdeps/ieee754/dbl-64/wordsize-64/s_lround.c: Empty file.
+
+2012-03-16 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/unix/sysv/linux/x86_64/makecontext.c (__makecontext):
+ Use greg_t on sp. Use unsigned int on idx_uc_link. Cast
+ adresses to uintptr_t. Replace "long int" and "unsigned long
+ int" with "greg_t" on va_arg.
+
+2012-03-16 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/generic/ldconfig.h (FLAG_X8664_LIBX32): New macro.
+ * elf/cache.c (print_entry): Handle FLAG_X8664_LIBX32.
+
+ * sysdeps/unix/sysv/linux/i386/readelflib.c (process_elf_file):
+ Move e_machine check before EI_CLASS check. Handle x32
+ libraries. Check EM_IA_64 only if SKIP_EM_IA_64 isn't defined.
+ * sysdeps/unix/sysv/linux/x86_64/readelflib.c: Just define
+ SKIP_EM_IA_64 and include
+ <sysdeps/unix/sysv/linux/i386/readelflib.c>.
+
+ * sysdeps/unix/sysv/linux/x86_64/dl-cache.h:
+ Don't include <sysdeps/unix/sysv/linux/sparc/dl-cache.h>.
+ (add_system_dir): New macro.
+
+ * sysdeps/unix/sysv/linux/x86_64/ldconfig.h
+ (SYSDEP_KNOWN_INTERPRETER_NAMES): Add /libx32/ld-linux-x32.so.2.
+
+2012-03-16 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #2551]
+ [BZ #2552]
+ [BZ #2553]
+ [BZ #2554]
+ [BZ #2562]
+ [BZ #2563]
+ [BZ #2565]
+ [BZ #2566]
+ [BZ #2576]
+ * math/w_j0.c (j0): Don't produce TLOSS errors for POSIX libm.
+ (y0): Likewise.
+ * math/w_j0f.c (j0f): Likewise.
+ (y0f): Likewise.
+ * math/w_j0l.c (__j0l): Likewise.
+ (__y0l): Likewise.
+ * math/w_j1.c (j1): Likewise.
+ (y1): Likewise.
+ * math/w_j1f.c (j1f): Likewise.
+ (y1f): Likewise.
+ * math/w_j1l.c (__j1l): Likewise.
+ (__y1l): Likewise.
+ * math/w_jn.c (jn): Likewise.
+ (yn): Likewise.
+ * math/w_jnf.c (jnf): Likewise.
+ (ynf): Likewise.
+ * math/w_jnl.c (__jnl): Likewise.
+ (__ynl): Likewise.
+ * math/libm-test.inc (j0_test): Add more tests.
+ (j1_test): Likewise.
+ (jn_test): Likewise. Add trailing semicolon to existing test.
+ (y0_test): Likewise.
+ (y1_test): Likewise.
+ * sysdeps/i386/fpu/libm-test-ulps: Update.
+ * sysdeps/x86_64/fpu/libm-test-ulps: Likewise.
+
+ [BZ #13851]
+ [BZ #13854]
+ * sysdeps/ieee754/dbl-64/s_tan.c (tan): Use
+ libc_feholdexcept_setround_53bit and libc_feupdateenv_53bit.
+ * sysdeps/ieee754/ldbl-96/k_tanl.c: New file.
+ * sysdeps/ieee754/ldbl-96/s_tanl.c: Include <errno.h>.
+ (__tanl): Set errno for infinite argument.
+ * sysdeps/i386/fpu/mptan.c: Remove.
+ * sysdeps/i386/fpu/s_tan.S: Likewise.
+ * sysdeps/i386/fpu/s_tanl.S: Likewise.
+ * sysdeps/x86_64/fpu/k_tanl.c: Likewise.
+ * sysdeps/x86_64/fpu/s_tanl.S: Likewise.
+ * math/libm-test.inc (tan_test): Add more tests and enable more
+ tests for double and long double.
+ * sysdeps/i386/fpu/libm-test-ulps: Update.
+ * sysdeps/x86_64/fpu/libm-test-ulps: Likewise.
+
+2012-03-16 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ * sysdeps/x86_64/elf/start.S: Include <sysdep.h>.
+ (_start): Add cfi_startproc, cfi_undefined for rip and cfi_endproc.
+
+2012-03-16 Roland McGrath <roland@hack.frob.com>
+
+ * aclocal.m4 (LIBC_PRECONFIGURE): New macro.
+ * configure.in: Use it for both main tree and add-ons.
+ * configure: Regenerated.
+
+2012-03-16 H.J. Lu <hongjiu.lu@intel.com>
+
+ * time/offtime.c (__offtime): Use time_t on days, rem, y and yg.
+
+2012-03-16 Joseph Myers <joseph@codesourcery.com>
+
+ * sysdeps/ieee754/ldbl-96/t_sincosl.c: Include generator program
+ in comment.
+
+ [BZ #13851]
+ * sysdeps/ieee754/ldbl-96/e_rem_pio2l.c: New file.
+ * sysdeps/ieee754/ldbl-96/k_cosl.c: Likewise.
+ * sysdeps/ieee754/ldbl-96/k_sinl.c: Likewise.
+ * sysdeps/ieee754/ldbl-96/t_sincosl.c: Likewise.
+ * sysdeps/ieee754/ldbl-96/s_cosl.c (__cosl): Correct test for
+ infinite argument.
+ * sysdeps/ieee754/ldbl-96/s_sinl.c (__sinl): Likewise.
+ * sysdeps/ieee754/dbl-64/k_rem_pio2.c: Handle __FLT_EVAL_METHOD__
+ != 0 for prec == 2.
+ * sysdeps/i386/fpu/e_rem_pio2l.c: Remove.
+ * sysdeps/i386/fpu/k_rem_pio2.c: Likewise.
+ * sysdeps/i386/fpu/s_cosl.S: Likewise.
+ * sysdeps/i386/fpu/s_sincosl.S: Likewise.
+ * sysdeps/i386/fpu/s_sinl.S: Likewise.
+ * sysdeps/x86_64/fpu/e_rem_pio2l.c: Likewise.
+ * sysdeps/x86_64/fpu/k_cosl.c: Likewise.
+ * sysdeps/x86_64/fpu/k_sinl.c: Likewise.
+ * sysdeps/x86_64/fpu/s_cosl.S: Likewise.
+ * sysdeps/x86_64/fpu/s_sincosl.S: Likewise.
+ * sysdeps/x86_64/fpu/s_sinl.S: Likewise.
+ * math/libm-test.inc (cos_test): Add more tests and enable more
+ tests for long double.
+ (sin_test): Likewise.
+ (sincos_test): Likewise.
+ * sysdeps/i386/fpu/libm-test-ulps: Update.
+ * sysdeps/x86_64/fpu/libm-test-ulps: Likewise.
+
+2012-03-16 David S. Miller <davem@davemloft.net>
+
+ * sysdeps/sparc/fpu/math_private.h: New file.
+
+2012-03-15 David S. Miller <davem@davemloft.net>
+
+ * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fma-vis3.S: New
+ file.
+ * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fma.c: New file.
+ * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmaf-vis3.S: New
+ file.
+ * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmaf.c: New file.
+ * sysdeps/sparc/sparc64/fpu/multiarch/s_fma-vis3.S: New file.
+ * sysdeps/sparc/sparc64/fpu/multiarch/s_fma.c: New file.
+ * sysdeps/sparc/sparc64/fpu/multiarch/s_fmaf-vis3.S: New file.
+ * sysdeps/sparc/sparc64/fpu/multiarch/s_fmaf.c: New file.
+ * sysdeps/sparc/sparc64/fpu/multiarch/Makefile: Add fma/fmaf
+ sysdep routines.
+ * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/Makefile: Likewise.
+
+ * sysdeps/sparc/sparc32/fpu/s_fma.c: New file.
+ * sysdeps/sparc/sparc64/fpu/s_fma.c: New file.
+
+ * sysdeps/sparc/sparc-ifunc.h: New file.
+ * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceil.S: Use
+ sparc-ifunc.h
+ * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceilf.S: Likewise.
+ * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysign.S:
+ Likewise.
+ * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysignf.S:
+ Likewise.
+ * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabs.S: Likewise.
+ * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabsf.S: Likewise.
+ * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floor.S: Likewise.
+ * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floorf.S:
+ Likewise.
+ * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmax.S: Likewise.
+ * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmaxf.S: Likewise.
+ * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmin.S: Likewise.
+ * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fminf.S: Likewise.
+ * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrint.S:
+ Likewise.
+ * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrintf.S:
+ Likewise.
+ * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rint.S: Likewise.
+ * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rintf.S: Likewise.
+ * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/w_sqrt.S: Likewise.
+ * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/w_sqrtf.S: Likewise.
+ * sysdeps/sparc/sparc64/fpu/multiarch/s_ceil.S: Likewise.
+ * sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf.S: Likewise.
+ * sysdeps/sparc/sparc64/fpu/multiarch/s_finite.S: Likewise.
+ * sysdeps/sparc/sparc64/fpu/multiarch/s_finitef.S: Likewise.
+ * sysdeps/sparc/sparc64/fpu/multiarch/s_floor.S: Likewise.
+ * sysdeps/sparc/sparc64/fpu/multiarch/s_floorf.S: Likewise.
+ * sysdeps/sparc/sparc64/fpu/multiarch/s_fmax.S: Likewise.
+ * sysdeps/sparc/sparc64/fpu/multiarch/s_fmaxf.S: Likewise.
+ * sysdeps/sparc/sparc64/fpu/multiarch/s_fmin.S: Likewise.
+ * sysdeps/sparc/sparc64/fpu/multiarch/s_fminf.S: Likewise.
+ * sysdeps/sparc/sparc64/fpu/multiarch/s_isinf.S: Likewise.
+ * sysdeps/sparc/sparc64/fpu/multiarch/s_isinff.S: Likewise.
+ * sysdeps/sparc/sparc64/fpu/multiarch/s_isnan.S: Likewise.
+ * sysdeps/sparc/sparc64/fpu/multiarch/s_isnanf.S: Likewise.
+ * sysdeps/sparc/sparc64/fpu/multiarch/s_lrint.S: Likewise.
+ * sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf.S: Likewise.
+ * sysdeps/sparc/sparc64/fpu/multiarch/s_rint.S: Likewise.
+ * sysdeps/sparc/sparc64/fpu/multiarch/s_rintf.S: Likewise.
+ * sysdeps/sparc/sparc64/fpu/multiarch/s_signbit.S: Likewise.
+ * sysdeps/sparc/sparc64/fpu/multiarch/s_signbitf.S: Likewise.
+
+2012-03-15 Andreas Schwab <schwab@linux-m68k.org>
+
+ * sysdeps/powerpc/fpu/e_hypotf.c: Use double precision instead of
+ scaling.
+ * sysdeps/powerpc/fpu/libm-test-ulps: Update.
+
+2012-03-15 Andreas Jaeger <aj@suse.de>
+
+ [BZ #13852]
+ * sysdeps/i386/fpu/e_rem_pio2f.c: Delete so that i386 uses the
+ ieee754/flt-32 implementation for sin, cos and sincos.
+ * sysdeps/i386/fpu/k_rem_pio2f.c: Likewise.
+ * sysdeps/i386/fpu/s_cosf.S: Likewise.
+ * sysdeps/i386/fpu/s_sincosf.S: Likewise.
+ * sysdeps/i386/fpu/s_sinf.S: Likewise.
+ * sysdeps/i386/fpu/s_tanf.S: Delete so that i386 uses the
+ ieee754/flt-32 implementation for tan.
+
+ * math/libm-test.inc (cos_test): Enable some large input tests for
+ float as well
+ (sin_test): Likewise.
+ (sincos_test): Likewise.
+ (tan_test): Add tests for large input.
+
+ * sysdeps/i386/fpu/libm-test-ulps: Update.
+
+2012-03-15 Andreas Jaeger <aj@suse.de>
+
+ [BZ #13658]
+ * math/libm-test.inc (cos_test): Add more test cases.
+ (sin_test): Likewise.
+ (sincos_test): Likewise.
+
+2012-03-15 Andreas Jaeger <aj@suse.de>
+
+ [BZ #13837]
+ * math/libm-test.inc (cos_test): Add a test case for large input
+ value.
+ (sin_test): Likewise.
+ (sincos_test): Likewise.
+
+2012-03-15 Andreas Jaeger <aj@suse.de>,
+ Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #13658]
+ * sysdeps/x86_64/fpu/s_sincos.S: Delete files so that
+ x86-64 and i386 use the iee754/dbl-64 sin and cos implementation.
+ * sysdeps/i386/fpu/branred.c: Likewise.
+ * sysdeps/i386/fpu/dosincos.c: Likewise.
+ * sysdeps/i386/fpu/mpa.c: Likewise.
+ * sysdeps/i386/fpu/s_cos.S: Likewise.
+ * sysdeps/i386/fpu/s_sin.S: Likewise.
+ * sysdeps/i386/fpu/s_sincos.S: Likewise.
+ * sysdeps/i386/fpu/sincos32.c: Likewise.
+
+ * sysdeps/generic/math_private.h (libc_feholdexcept_setround_53bit):
+ Define.
+ (libc_feupdateenv_53bit): Define.
+ * sysdeps/i386/fpu/math_private.h (libc_feholdexcept_setround_53bit):
+ Define.
+ (libc_feupdateenv_53bit): Define.
+
+ * sysdeps/ieee754/dbl-64/s_sin.c (__sin): Do double arithmetic in
+ 53 bit (without extend i386 double precision).
+
+ * math/libm-test.inc (sincos_test): Add tests for large input.
+ (sin): Likewise.
+ (cos): Likewise.
+
+ * sysdeps/i386/fpu/libm-test-ulps: Update ULPs.
+
+2012-03-15 Andreas Schwab <schwab@linux-m68k.org>
+
+ * sysdeps/powerpc/fpu/libm-test-ulps: Update.
+
+2012-03-15 David S. Miller <davem@davemloft.net>
+
+ * sysdeps/sparc/sparc64/fpu/s_fmax.S: New file.
+ * sysdeps/sparc/sparc64/fpu/s_fmaxf.S: New file.
+ * sysdeps/sparc/sparc64/fpu/s_fmin.S: New file.
+ * sysdeps/sparc/sparc64/fpu/s_fminf.S: New file.
+ * sysdeps/sparc/sparc32/sparcv9/fpu/s_fmax.S: New file.
+ * sysdeps/sparc/sparc32/sparcv9/fpu/s_fmaxf.S: New file.
+ * sysdeps/sparc/sparc32/sparcv9/fpu/s_fmin.S: New file.
+ * sysdeps/sparc/sparc32/sparcv9/fpu/s_fminf.S: New file.
+ * sysdeps/sparc/sparc64/fpu/multiarch/s_fmax.S: New file.
+ * sysdeps/sparc/sparc64/fpu/multiarch/s_fmaxf-vis3.S: New file.
+ * sysdeps/sparc/sparc64/fpu/multiarch/s_fmaxf.S: New file.
+ * sysdeps/sparc/sparc64/fpu/multiarch/s_fmin-vis3.S: New file.
+ * sysdeps/sparc/sparc64/fpu/multiarch/s_fmin.S: New file.
+ * sysdeps/sparc/sparc64/fpu/multiarch/s_fminf-vis3.S: New file.
+ * sysdeps/sparc/sparc64/fpu/multiarch/s_fminf.S: New file.
+ * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmax-vis3.S: New
+ file.
+ * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmax.S: New file.
+ * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmaxf-vis3.S: New
+ file.
+ * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmaxf.S: New file.
+ * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmin-vis3.S: New
+ file.
+ * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmin.S: New file.
+ * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fminf-vis3.S: New
+ file.
+ * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fminf.S: New file.
+ * sysdeps/sparc/sparc64/fpu/multiarch/Makefile: Add new vis3
+ fmin/fmax sysdep routines.
+ * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/Makefile: Likewise.
+
+2012-03-14 David S. Miller <davem@davemloft.net>
+
+ * sysdeps/sparc/sparc64/fpu/multiarch/s_ceil-vis3.S: New file.
+ * sysdeps/sparc/sparc64/fpu/multiarch/s_ceil.S: New file.
+ * sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf-vis3.S: New file.
+ * sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf.S: New file.
+ * sysdeps/sparc/sparc64/fpu/multiarch/s_finite-vis3.S: New file.
+ * sysdeps/sparc/sparc64/fpu/multiarch/s_finite.S: New file.
+ * sysdeps/sparc/sparc64/fpu/multiarch/s_finitef-vis3.S: New file.
+ * sysdeps/sparc/sparc64/fpu/multiarch/s_finitef.S: New file.
+ * sysdeps/sparc/sparc64/fpu/multiarch/s_floor-vis3.S: New file.
+ * sysdeps/sparc/sparc64/fpu/multiarch/s_floor.S: New file.
+ * sysdeps/sparc/sparc64/fpu/multiarch/s_floorf-vis3.S: New file.
+ * sysdeps/sparc/sparc64/fpu/multiarch/s_floorf.S: New file.
+ * sysdeps/sparc/sparc64/fpu/multiarch/s_isinf-vis3.S: New file.
+ * sysdeps/sparc/sparc64/fpu/multiarch/s_isinf.S: New file.
+ * sysdeps/sparc/sparc64/fpu/multiarch/s_isinff-vis3.S: New file.
+ * sysdeps/sparc/sparc64/fpu/multiarch/s_isinff.S: New file.
+ * sysdeps/sparc/sparc64/fpu/multiarch/s_isnan-vis3.S: New file.
+ * sysdeps/sparc/sparc64/fpu/multiarch/s_isnan.S: New file.
+ * sysdeps/sparc/sparc64/fpu/multiarch/s_isnanf-vis3.S: New file.
+ * sysdeps/sparc/sparc64/fpu/multiarch/s_isnanf.S: New file.
+ * sysdeps/sparc/sparc64/fpu/multiarch/s_lrint-vis3.S: New file.
+ * sysdeps/sparc/sparc64/fpu/multiarch/s_lrint.S: New file.
+ * sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf-vis3.S: New file.
+ * sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf.S: New file.
+ * sysdeps/sparc/sparc64/fpu/multiarch/s_rint-vis3.S: New file.
+ * sysdeps/sparc/sparc64/fpu/multiarch/s_rint.S: New file.
+ * sysdeps/sparc/sparc64/fpu/multiarch/s_rintf-vis3.S: New file.
+ * sysdeps/sparc/sparc64/fpu/multiarch/s_rintf.S: New file.
+ * sysdeps/sparc/sparc64/fpu/multiarch/Makefile: Add new VIS3
+ routines.
+ * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceil-vis3.S: New
+ file.
+ * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceil.S: New file.
+ * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceilf-vis3.S: New
+ file.
+ * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceilf.S: New file.
+ * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabs-vis3.S: New
+ file.
+ * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabs.S: New file.
+ * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabsf-vis3.S: New
+ file.
+ * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabsf.S: New file.
+ * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floor-vis3.S: New
+ file.
+ * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floor.S: New file.
+ * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floorf-vis3.S: New
+ file.
+ * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floorf.S: New
+ file.
+ * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrint-vis3.S: New
+ file.
+ * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrint.S: New
+ file.
+ * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrintf-vis3.S:
+ New file.
+ * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrintf.S: New
+ file.
+ * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rint-vis3.S: New
+ file.
+ * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rint.S: New file.
+ * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rintf-vis3.S: New
+ file.
+ * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rintf.S: New file.
+ * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/w_sqrt-vis3.S: New
+ file.
+ * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/w_sqrt.S: New file.
+ * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/w_sqrtf-vis3.S: New
+ file.
+ * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/w_sqrtf.S: New file.
+ * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/Makefile: Add new
+ VIS3 routines.
+
+ * sysdeps/sparc/sparc32/sparcv9/fpu/unix/sysv/linux/multiarch/Implies:
+ New file.
+
+ * sysdeps/sparc/fpu/libm-test-ulps: Update.
+
+ * sysdeps/sparc/configure.in: New file.
+ * sysdeps/sparc/configure: Generate.
+ * configure.in (libc_cv_sparc_as_vis3): Substitute.
+ * configure: Regenerate.
+ * config.h.in (HAVE_AS_VIS3_SUPPORT): New.
+ * config.make.in (have-as-vis3): New.
+ * sysdeps/sparc/sparc32/sparcv9/Makefile (ASFLAGS-*): If VIS3 is
+ available use -Av9d instead of -Av9a.
+ * sysdeps/sparc/sparc64/Makefile: Likewise.
+ * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/Makefile: New file.
+ * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysign-vis3.S:
+ New file.
+ * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysign.S: New
+ file.
+ * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysignf-vis3.S:
+ New file.
+ * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysignf.S: New
+ file.
+ * sysdeps/sparc/sparc64/fpu/multiarch/Makefile: New file.
+ * sysdeps/sparc/sparc64/fpu/multiarch/s_signbit-vis3.S: New file.
+ * sysdeps/sparc/sparc64/fpu/multiarch/s_signbit.S: New file.
+ * sysdeps/sparc/sparc64/fpu/multiarch/s_signbitf-vis3.S: New file.
+ * sysdeps/sparc/sparc64/fpu/multiarch/s_signbitf.S: New file.
+
+ * sysdeps/sparc/sparc64/fpu/s_copysign.S (__copysign): Use
+ fzeros/fnegs to load 0x80000000 into a float register instead of
+ using the stack.
+ * sysdeps/sparc/sparc64/fpu/s_copysignf.S (__copysignf): Likewise.
+
+2012-03-14 Joseph Myers <joseph@codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/Makefile (sysdep_headers): Add
+ bits/syscall.h.
+ ($(objpfx)syscall-%.h): Rename rule to $(objpfx)bits/syscall%h.
+ ($(objpfx)syscall-%.d): Rename rule to $(objpfx)bits/syscall%d.
+ ($(inst_includedir)/bits/syscall.h): Remove rule.
+ ($(objpfx)bits/syscall.d): Include instead of
+ $(objpfx)syscall-list.d.
+ (generated): Change syscall-list.h and syscall-list.d to
+ bits/syscall.h and bits/syscall.d.
+
+2012-03-14 Roland McGrath <roland@hack.frob.com>
+
+ [BZ #13846]
+ * manual/llio.texi (Memory-mapped I/O): Fix wrong function name.
+
+2012-03-14 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #13841]
+ * math/s_csqrt.c: Include <float.h>.
+ (__csqrt): Scale large or subnormal inputs.
+ * math/s_csqrtf.c: Likewise.
+ * math/s_csqrtl.c: Likewise.
+ * math/libm-test.inc (csqrt_test): Add more tests.
+ * sysdeps/i386/fpu/libm-test-ulps: Update.
+ * sysdeps/x86_64/fpu/libm-test-ulps: Likewise.
+
+ [BZ #13840]
+ * math/libm-test.inc (hypot_test): Add more tests.
+
+2012-03-13 David S. Miller <davem@davemloft.net>
+
+ [BZ #13840]
+ * sysdeps/ieee754/flt-32/e_hypotf.c (__ieee754_hypotf): Rewrite to use
+ double-precision for the calculation instead of scaling.
+
+2012-03-13 Joseph Myers <joseph@codesourcery.com>
+
+ * sysdeps/ieee754/dbl-64/s_nearbyint.c (__nearbyint): Do not
+ manipulate bits before adding and subtracting TWO52[sx].
+ * sysdeps/ieee754/dbl-64/s_rint.c (__rint): Likewise.
+ * sysdeps/ieee754/dbl-64/wordsize-64/s_nearbyint.c (__nearbyint):
+ Likewise.
+ * sysdeps/ieee754/dbl-64/wordsize-64/s_rint.c (__rint): Likewise.
+
+2012-03-13 David S. Miller <davem@davemloft.net>
+
+ * sysdeps/sparc/Makefile: Remove rtld-global-offsets.sym handling.
+ * sysdeps/sparc/elf/rtld-global-offsets.sym: Delete.
+ * sysdeps/sparc/sparc64/multiarch/memcpy.S: Don't include
+ rtld-global-offsets.h
+ * sysdeps/sparc/sparc64/multiarch/memset.S: Likewise.
+
+ * sysdeps/ieee754/ldbl-128/s_expm1l.c (__expm1l): Use expl for
+ large parameters.
+
+ * sysdeps/unix/sysv/linux/sparc/sparc64/dl-fxstatat64.c: New file.
+
+ * sysdeps/unix/sysv/linux/openat.c (OPENAT_NOT_CANCEL): Declare syscall
+ 'err' in the ifdef scope in which it is actually used.
+
+ * nss/nss_db/db-init.c: Include string.h
+
+2012-03-12 David S. Miller <davem@davemloft.net>
+
+ * sysdeps/generic/dl-osinfo.h (_dl_setup_stack_chk_guard): Fix
+ masking out of the most significant byte of random value used.
+ * sysdeps/unix/sysv/linux/dl-osinfo.h (_dl_setup_stack_chk_guard):
+ Fix coding style in previous change.
+
+ * sysdeps/unix/sysv/linux/kernel-features.h
+ (__ASSUME_CLONE_THREAD_FLAGS): Set on sparc when 2.5.64 and later.
+ (__ASSUME_TGKILL): Set on sparc when 2.6.1 and later, simplify
+ expression.
+ (__ASSUME_FADVISE64_64_SYSCALL): Set on sparc when 2.6.1 and
+ later.
+
+2012-03-11 David S. Miller <davem@davemloft.net>
+
+ * sysdeps/unix/sysv/linux/sparc/sparc64/makecontext.c
+ (__makecontext): Fix signedness of pointer casts setting up 'sp'.
+ * sysdeps/unix/sysv/linux/sparc/sysdep.h (INLINE_SYSCALL) Use 'long'
+ for 'resultvar' otherwise things get truncated on 64-bit.
+
+ * sysdeps/unix/sysv/linux/dl-osinfo.h (_dl_setup_stack_chk_guard):
+ Fix masking out of the most significant byte of random value used.
+
+ * sysdeps/sparc/fpu/libm-test-ulps: Update.
+
+2012-03-10 Andreas Schwab <schwab@linux-m68k.org>
+
+ * sysdeps/powerpc/fpu/libm-test-ulps: Update.
+
+2012-03-09 David S. Miller <davem@davemloft.net>
+
+ * sysdeps/sparc/sparc32/dl-machine.h (elf_machine_rela): Protect local
+ variables with appropriate CPP guards.
+ * sysdeps/sparc/sparc32/dl-trampoline.S: Propagate the stack_ptr from the
+ frame pointer, not the stack pointer. Correct layout comments. Fix test
+ on resulting framesize and the management of the outregs buffer for pltexit.
+ Preserve floating point return values across _dl_call_pltexit call.
+ * sysdeps/sparc/sparc64/dl-trampoline.S: Fix test on resulting
+ framesize and the management of the outregs buffer for pltexit.
+ Preserve floating point return values across _dl_call_pltexit
+ call.
+ * elf/sotruss-lib.c (la_sparc32_gnu_pltenter, la_sparc64_gnu_pltenter,
+ la_sparc32_gnu_pltexit, la_sparc64_gnu_pltexit): New functions.
+ (print_exit): Fix format string for return register value.
+
2012-03-10 Joseph Myers <joseph@codesourcery.com>
* sunrpc/Makefile (others): Add rpcgen.
diff --git a/libc/Makefile b/libc/Makefile
index 9af58ee46..dd4687951 100644
--- a/libc/Makefile
+++ b/libc/Makefile
@@ -1,5 +1,4 @@
-# Copyright (C) 1991-2002,2003,2004,2005,2006,2008,2009,2011
-# Free Software Foundation, Inc.
+# Copyright (C) 1991-2012 Free Software Foundation, Inc.
# This file is part of the GNU C Library.
# The GNU C Library is free software; you can redistribute it and/or
@@ -384,7 +383,7 @@ TAGS:
generated := $(generated) stubs.h
-files-for-dist := README FAQ INSTALL NOTES configure ChangeLog NEWS
+files-for-dist := README FAQ INSTALL configure ChangeLog NEWS
# Regenerate stuff, then error if these things are not committed yet.
dist-prepare: $(files-for-dist)
@@ -419,7 +418,6 @@ makeinfo --no-validate --plaintext --no-number-sections $< -o $@
-chmod a-w $@
endef
INSTALL: manual/install.texi manual/macros.texi; $(format-me)
-NOTES: manual/creature.texi manual/macros.texi; $(format-me)
manual/dir-add.texi manual/dir-add.info: FORCE
$(MAKE) $(PARALLELMFLAGS) -C $(@D) $(@F)
FAQ: scripts/gen-FAQ.pl FAQ.in
diff --git a/libc/Makerules b/libc/Makerules
index 2ed87e04a..40d11fc57 100644
--- a/libc/Makerules
+++ b/libc/Makerules
@@ -1189,14 +1189,6 @@ $(BUILD_CC) $($(basename $(<F))-CFLAGS) $(ALL_BUILD_CFLAGS) \
$(firstword $(filter /%,$< $(shell pwd)/$<)) -o $(@F)
endef
-# Command to compile $< in $(common-objdir) using the native libraries.
-# We must cd to $(objdir) anyway so that $(..)config.h is valid.
-define common-objdir-compile
-$(patsubst %/,cd % &&,$(objpfx)) \
-$(BUILD_CC) $($(basename $(<F))-CFLAGS) $(ALL_BUILD_CFLAGS) \
- $(firstword $(filter /%,$< $(shell pwd)/$<)) -o $(..)$(@F)
-endef
-
# We always want to use configuration definitions.
# Note that this is only used for commands running in $(objpfx).
ALL_BUILD_CFLAGS = $(BUILD_CFLAGS) -include $(..)config.h
diff --git a/libc/NEWS b/libc/NEWS
index b6cd0a97c..5fc444464 100644
--- a/libc/NEWS
+++ b/libc/NEWS
@@ -9,12 +9,14 @@ Version 2.16
* The following bugs are resolved with this release:
- 174, 350, 411, 2541, 2547, 2548, 3335, 3976, 3992, 4026, 4108, 4596, 4822,
- 5077, 5461, 5805, 5993, 6884, 6907, 6911, 9739, 9902, 10110, 10135, 10140,
- 10210, 10545, 10716, 11174, 11322, 11365, 11494, 12047, 13058, 13525,
+ 174, 350, 411, 2541, 2547, 2548, 2551, 2552, 2553, 2554, 2562, 2563, 2565,
+ 2566, 2576, 3335, 3976, 3992, 4026, 4108, 4596, 4822, 5077, 5461, 5805,
+ 5993, 6471, 6884, 6907, 6911, 9739, 9902, 10110, 10135, 10140, 10210,
+ 10545, 10716, 11174, 11322, 11365, 11451, 11494, 12047, 13058, 13525,
13526, 13527, 13528, 13529, 13530, 13531, 13532, 13533, 13547, 13551,
- 13552, 13553, 13555, 13559, 13566, 13583, 13618, 13637, 13656, 13673,
- 13695, 13704, 13706, 13726, 13738, 13786, 13792, 13806
+ 13552, 13553, 13555, 13559, 13566, 13583, 13618, 13637, 13656, 13658,
+ 13673, 13695, 13704, 13706, 13726, 13738, 13786, 13792, 13806, 13840,
+ 13841, 13844, 13846, 13851, 13852, 13854, 13871, 13883
* ISO C11 support:
diff --git a/libc/NOTES b/libc/NOTES
deleted file mode 100644
index 552f4cd60..000000000
--- a/libc/NOTES
+++ /dev/null
@@ -1,223 +0,0 @@
-Feature Test Macros
--------------------
-
-The exact set of features available when you compile a source file is
-controlled by which "feature test macros" you define.
-
- If you compile your programs using `gcc -ansi', you get only the
-ISO C library features, unless you explicitly request additional
-features by defining one or more of the feature macros. *Note GNU CC
-Command Options: (gcc.info)Invoking GCC, for more information about GCC
-options.
-
- You should define these macros by using `#define' preprocessor
-directives at the top of your source code files. These directives
-_must_ come before any `#include' of a system header file. It is best
-to make them the very first thing in the file, preceded only by
-comments. You could also use the `-D' option to GCC, but it's better
-if you make the source files indicate their own meaning in a
-self-contained way.
-
- This system exists to allow the library to conform to multiple
-standards. Although the different standards are often described as
-supersets of each other, they are usually incompatible because larger
-standards require functions with names that smaller ones reserve to the
-user program. This is not mere pedantry -- it has been a problem in
-practice. For instance, some non-GNU programs define functions named
-`getline' that have nothing to do with this library's `getline'. They
-would not be compilable if all features were enabled indiscriminately.
-
- This should not be used to verify that a program conforms to a
-limited standard. It is insufficient for this purpose, as it will not
-protect you from including header files outside the standard, or
-relying on semantics undefined within the standard.
-
- -- Macro: _POSIX_SOURCE
- If you define this macro, then the functionality from the POSIX.1
- standard (IEEE Standard 1003.1) is available, as well as all of the
- ISO C facilities.
-
- The state of `_POSIX_SOURCE' is irrelevant if you define the macro
- `_POSIX_C_SOURCE' to a positive integer.
-
- -- Macro: _POSIX_C_SOURCE
- Define this macro to a positive integer to control which POSIX
- functionality is made available. The greater the value of this
- macro, the more functionality is made available.
-
- If you define this macro to a value greater than or equal to `1',
- then the functionality from the 1990 edition of the POSIX.1
- standard (IEEE Standard 1003.1-1990) is made available.
-
- If you define this macro to a value greater than or equal to `2',
- then the functionality from the 1992 edition of the POSIX.2
- standard (IEEE Standard 1003.2-1992) is made available.
-
- If you define this macro to a value greater than or equal to
- `199309L', then the functionality from the 1993 edition of the
- POSIX.1b standard (IEEE Standard 1003.1b-1993) is made available.
-
- Greater values for `_POSIX_C_SOURCE' will enable future extensions.
- The POSIX standards process will define these values as necessary,
- and the GNU C Library should support them some time after they
- become standardized. The 1996 edition of POSIX.1 (ISO/IEC 9945-1:
- 1996) states that if you define `_POSIX_C_SOURCE' to a value
- greater than or equal to `199506L', then the functionality from
- the 1996 edition is made available.
-
- -- Macro: _BSD_SOURCE
- If you define this macro, functionality derived from 4.3 BSD Unix
- is included as well as the ISO C, POSIX.1, and POSIX.2 material.
-
- Some of the features derived from 4.3 BSD Unix conflict with the
- corresponding features specified by the POSIX.1 standard. If this
- macro is defined, the 4.3 BSD definitions take precedence over the
- POSIX definitions.
-
- Due to the nature of some of the conflicts between 4.3 BSD and
- POSIX.1, you need to use a special "BSD compatibility library"
- when linking programs compiled for BSD compatibility. This is
- because some functions must be defined in two different ways, one
- of them in the normal C library, and one of them in the
- compatibility library. If your program defines `_BSD_SOURCE', you
- must give the option `-lbsd-compat' to the compiler or linker when
- linking the program, to tell it to find functions in this special
- compatibility library before looking for them in the normal C
- library.
-
- -- Macro: _SVID_SOURCE
- If you define this macro, functionality derived from SVID is
- included as well as the ISO C, POSIX.1, POSIX.2, and X/Open
- material.
-
- -- Macro: _XOPEN_SOURCE
- -- Macro: _XOPEN_SOURCE_EXTENDED
- If you define this macro, functionality described in the X/Open
- Portability Guide is included. This is a superset of the POSIX.1
- and POSIX.2 functionality and in fact `_POSIX_SOURCE' and
- `_POSIX_C_SOURCE' are automatically defined.
-
- As the unification of all Unices, functionality only available in
- BSD and SVID is also included.
-
- If the macro `_XOPEN_SOURCE_EXTENDED' is also defined, even more
- functionality is available. The extra functions will make all
- functions available which are necessary for the X/Open Unix brand.
-
- If the macro `_XOPEN_SOURCE' has the value 500 this includes all
- functionality described so far plus some new definitions from the
- Single Unix Specification, version 2.
-
- -- Macro: _LARGEFILE_SOURCE
- If this macro is defined some extra functions are available which
- rectify a few shortcomings in all previous standards.
- Specifically, the functions `fseeko' and `ftello' are available.
- Without these functions the difference between the ISO C interface
- (`fseek', `ftell') and the low-level POSIX interface (`lseek')
- would lead to problems.
-
- This macro was introduced as part of the Large File Support
- extension (LFS).
-
- -- Macro: _LARGEFILE64_SOURCE
- If you define this macro an additional set of functions is made
- available which enables 32 bit systems to use files of sizes beyond
- the usual limit of 2GB. This interface is not available if the
- system does not support files that large. On systems where the
- natural file size limit is greater than 2GB (i.e., on 64 bit
- systems) the new functions are identical to the replaced functions.
-
- The new functionality is made available by a new set of types and
- functions which replace the existing ones. The names of these new
- objects contain `64' to indicate the intention, e.g., `off_t' vs.
- `off64_t' and `fseeko' vs. `fseeko64'.
-
- This macro was introduced as part of the Large File Support
- extension (LFS). It is a transition interface for the period when
- 64 bit offsets are not generally used (see `_FILE_OFFSET_BITS').
-
- -- Macro: _FILE_OFFSET_BITS
- This macro determines which file system interface shall be used,
- one replacing the other. Whereas `_LARGEFILE64_SOURCE' makes the
- 64 bit interface available as an additional interface,
- `_FILE_OFFSET_BITS' allows the 64 bit interface to replace the old
- interface.
-
- If `_FILE_OFFSET_BITS' is undefined, or if it is defined to the
- value `32', nothing changes. The 32 bit interface is used and
- types like `off_t' have a size of 32 bits on 32 bit systems.
-
- If the macro is defined to the value `64', the large file interface
- replaces the old interface. I.e., the functions are not made
- available under different names (as they are with
- `_LARGEFILE64_SOURCE'). Instead the old function names now
- reference the new functions, e.g., a call to `fseeko' now indeed
- calls `fseeko64'.
-
- This macro should only be selected if the system provides
- mechanisms for handling large files. On 64 bit systems this macro
- has no effect since the `*64' functions are identical to the
- normal functions.
-
- This macro was introduced as part of the Large File Support
- extension (LFS).
-
- -- Macro: _ISOC99_SOURCE
- Until the revised ISO C standard is widely adopted the new features
- are not automatically enabled. The GNU C Library nevertheless has
- a complete implementation of the new standard and to enable the
- new features the macro `_ISOC99_SOURCE' should be defined.
-
- -- Macro: _GNU_SOURCE
- If you define this macro, everything is included: ISO C89,
- ISO C99, POSIX.1, POSIX.2, BSD, SVID, X/Open, LFS, and GNU
- extensions. In the cases where POSIX.1 conflicts with BSD, the
- POSIX definitions take precedence.
-
- If you want to get the full effect of `_GNU_SOURCE' but make the
- BSD definitions take precedence over the POSIX definitions, use
- this sequence of definitions:
-
- #define _GNU_SOURCE
- #define _BSD_SOURCE
- #define _SVID_SOURCE
-
- Note that if you do this, you must link your program with the BSD
- compatibility library by passing the `-lbsd-compat' option to the
- compiler or linker. *NB:* If you forget to do this, you may get
- very strange errors at run time.
-
- -- Macro: _REENTRANT
- -- Macro: _THREAD_SAFE
- If you define one of these macros, reentrant versions of several
- functions get declared. Some of the functions are specified in
- POSIX.1c but many others are only available on a few other systems
- or are unique to the GNU C Library. The problem is the delay in
- the standardization of the thread safe C library interface.
-
- Unlike on some other systems, no special version of the C library
- must be used for linking. There is only one version but while
- compiling this it must have been specified to compile as thread
- safe.
-
- We recommend you use `_GNU_SOURCE' in new programs. If you don't
-specify the `-ansi' option to GCC and don't define any of these macros
-explicitly, the effect is the same as defining `_POSIX_C_SOURCE' to 2
-and `_POSIX_SOURCE', `_SVID_SOURCE', and `_BSD_SOURCE' to 1.
-
- When you define a feature test macro to request a larger class of
-features, it is harmless to define in addition a feature test macro for
-a subset of those features. For example, if you define
-`_POSIX_C_SOURCE', then defining `_POSIX_SOURCE' as well has no effect.
-Likewise, if you define `_GNU_SOURCE', then defining either
-`_POSIX_SOURCE' or `_POSIX_C_SOURCE' or `_SVID_SOURCE' as well has no
-effect.
-
- Note, however, that the features of `_BSD_SOURCE' are not a subset of
-any of the other feature test macros supported. This is because it
-defines BSD features that take precedence over the POSIX features that
-are requested by the other macros. For this reason, defining
-`_BSD_SOURCE' in addition to the other feature test macros does have an
-effect: it causes the BSD features to take priority over the conflicting
-POSIX features.
-
diff --git a/libc/README b/libc/README
index d2f61926a..a3c76fabd 100644
--- a/libc/README
+++ b/libc/README
@@ -112,10 +112,6 @@ following the bug-reporting instructions below. Please be sure to check
the manual in the current development sources to see if your problem has
already been corrected.
-The file NOTES contains a description of the feature-test macros used
-in the GNU C library, explaining how you can tell the library what
-facilities you want it to make available.
-
Please see http://www.gnu.org/software/libc/bugs.html for bug reporting
information. We are now using the Bugzilla system to track all bug reports.
This web page gives detailed information on how to report bugs properly.
diff --git a/libc/aclocal.m4 b/libc/aclocal.m4
index ef977fde3..626e4369b 100644
--- a/libc/aclocal.m4
+++ b/libc/aclocal.m4
@@ -130,6 +130,26 @@ AS_IF([AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -o conftest
[$2], [$3])
rm -f conftest*])
+dnl Test a compiler option or options with an empty input file.
+dnl LIBC_TRY_CC_OPTION([options], [action-if-true], [action-if-false])
+AC_DEFUN([LIBC_TRY_CC_OPTION],
+[AS_IF([AC_TRY_COMMAND([${CC-cc} $1 -xc /dev/null -S -o /dev/null])],
+ [$2], [$3])])
+
+dnl Find and source sysdeps/*/preconfigure.
+dnl LIBC_PRECONFIGURE([$srcdir], [for])
+AC_DEFUN([LIBC_PRECONFIGURE], [dnl
+if frags=`ls -d $1/sysdeps/*/preconfigure 2> /dev/null`
+then
+ AC_MSG_CHECKING($2 preconfigure fragments)
+ for frag in $frags; do
+ name=`echo "$frag" | sed 's@/[[^/]]*[$]@@;s@^.*/@@'`
+ echo $ECHO_N "$name $ECHO_C" >&AS_MESSAGE_FD
+ . "$frag"
+ done
+ AC_MSG_RESULT()
+fi])
+
# These two macros are taken from GCC's config/acx.m4.
dnl Support the --with-pkgversion configure option.
dnl ACX_PKGVERSION(default-pkgversion)
diff --git a/libc/config.h.in b/libc/config.h.in
index 5fdd0410f..d2d45204c 100644
--- a/libc/config.h.in
+++ b/libc/config.h.in
@@ -90,6 +90,9 @@
/* Defined on SPARC if GCC emits GOTDATA relocations. */
#undef HAVE_GCC_GOTDATA
+/* Define on SPARC if AS supports VIS3 instructions. */
+#undef HAVE_AS_VIS3_SUPPORT
+
/* Define if the linker supports the -z combreloc option. */
#undef HAVE_Z_COMBRELOC
diff --git a/libc/config.make.in b/libc/config.make.in
index b2c7c41e7..8568d9e05 100644
--- a/libc/config.make.in
+++ b/libc/config.make.in
@@ -58,6 +58,7 @@ enable-check-abi = @enable_check_abi@
have-forced-unwind = @libc_cv_forced_unwind@
have-fpie = @libc_cv_fpie@
have-mfma4 = @libc_cv_cc_fma4@
+have-as-vis3 = @libc_cv_sparc_as_vis3@
gnu89-inline-CFLAGS = @gnu89_inline@
have-ssp = @libc_cv_ssp@
have-selinux = @have_selinux@
diff --git a/libc/configure b/libc/configure
index 4b6aa9de2..087a4cdd5 100755
--- a/libc/configure
+++ b/libc/configure
@@ -616,6 +616,7 @@ shared
static
ldd_rewrite_script
use_ldconfig
+libc_cv_sparc_as_vis3
libc_cv_as_i686
libc_cv_cc_fma4
libc_cv_cc_novzeroupper
@@ -3885,6 +3886,19 @@ if test "${with_cpu+set}" = set; then :
fi
+if frags=`ls -d $srcdir/sysdeps/*/preconfigure 2> /dev/null`
+then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysdeps preconfigure fragments" >&5
+$as_echo_n "checking for sysdeps preconfigure fragments... " >&6; }
+ for frag in $frags; do
+ name=`echo "$frag" | sed 's@/[^/]*$@@;s@^.*/@@'`
+ echo $ECHO_N "$name $ECHO_C" >&6
+ . "$frag"
+ done
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5
+$as_echo "" >&6; }
+fi
+
# An add-on can set this when it wants to disable the sanity check below.
libc_config_ok=no
@@ -4002,17 +4016,17 @@ $d-srcdir = $subdir_srcdir"
fi
if test -n "$libc_add_on"; then
if frags=`ls -d $libc_add_on_srcdir/sysdeps/*/preconfigure 2> /dev/null`
- then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking add-on $libc_add_on for preconfigure fragments" >&5
+then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking add-on $libc_add_on for preconfigure fragments" >&5
$as_echo_n "checking add-on $libc_add_on for preconfigure fragments... " >&6; }
- for frag in $frags; do
- name=`echo "$frag" | sed 's@/[^/]*$@@;s@^.*/@@'`
- echo $ECHO_N "$name $ECHO_C" >&6
- . "$frag"
- done
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5
+ for frag in $frags; do
+ name=`echo "$frag" | sed 's@/[^/]*$@@;s@^.*/@@'`
+ echo $ECHO_N "$name $ECHO_C" >&6
+ . "$frag"
+ done
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5
$as_echo "" >&6; }
- fi
+fi
use_add_ons="$use_add_ons $libc_add_on"
add_ons_pfx="$add_ons_pfx $libc_add_on/"
test -z "$libc_add_on_canonical" ||
@@ -6704,18 +6718,17 @@ $as_echo_n "checking for -fstack-protector... " >&6; }
if ${libc_cv_ssp+:} false; then :
$as_echo_n "(cached) " >&6
else
- if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -Werror -fstack-protector
- -o /dev/null -c -x c /dev/null 1>&5'
+ if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -Werror -fstack-protector -xc /dev/null -S -o /dev/null'
{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
(eval $ac_try) 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; }
-then
+ test $ac_status = 0; }; }; then :
libc_cv_ssp=yes
else
libc_cv_ssp=no
fi
+
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_ssp" >&5
$as_echo "$libc_cv_ssp" >&6; }
@@ -7110,10 +7123,11 @@ else
(eval $ac_try) 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; }; then
+ test $ac_status = 0; }; }; then :
+
libc_cv_cc_submachine="$opt"
break
- fi
+fi
done
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_cc_submachine" >&5
@@ -7717,6 +7731,7 @@ fi
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -fPIC is default" >&5
$as_echo_n "checking whether -fPIC is default... " >&6; }
if ${libc_cv_pic_default+:} false; then :
diff --git a/libc/configure.in b/libc/configure.in
index 491c39e31..0cd73b692 100644
--- a/libc/configure.in
+++ b/libc/configure.in
@@ -322,6 +322,9 @@ AC_ARG_WITH([cpu],
esac
])
+dnl Let sysdeps/*/preconfigure act here, like they can in add-ons.
+LIBC_PRECONFIGURE([$srcdir], [for sysdeps])
+
# An add-on can set this when it wants to disable the sanity check below.
libc_config_ok=no
@@ -441,16 +444,7 @@ relative path required for add-on using \$libc_add_on_config_subdirs) ;;
}
fi
if test -n "$libc_add_on"; then
- if frags=`ls -d $libc_add_on_srcdir/sysdeps/*/preconfigure 2> /dev/null`
- then
- AC_MSG_CHECKING(add-on $libc_add_on for preconfigure fragments)
- for frag in $frags; do
- name=`echo "$frag" | sed 's@/[[^/]]*$@@;s@^.*/@@'`
- echo $ECHO_N "$name $ECHO_C" >&AS_MESSAGE_FD
- . "$frag"
- done
- AC_MSG_RESULT()
- fi
+ LIBC_PRECONFIGURE([$libc_add_on_srcdir], [add-on $libc_add_on for])
use_add_ons="$use_add_ons $libc_add_on"
add_ons_pfx="$add_ons_pfx $libc_add_on/"
test -z "$libc_add_on_canonical" ||
@@ -1787,13 +1781,10 @@ fi
AC_SUBST(fno_unit_at_a_time)
AC_CACHE_CHECK(for -fstack-protector, libc_cv_ssp, [dnl
-if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -Werror -fstack-protector
- -o /dev/null -c -x c /dev/null 1>&AS_MESSAGE_LOG_FD])
-then
- libc_cv_ssp=yes
-else
- libc_cv_ssp=no
-fi])
+LIBC_TRY_CC_OPTION([$CFLAGS $CPPFLAGS -Werror -fstack-protector],
+ [libc_cv_ssp=yes],
+ [libc_cv_ssp=no])
+])
AC_SUBST(libc_cv_ssp)
AC_CACHE_CHECK(for -fgnu89-inline, libc_cv_gnu89_inline, [dnl
@@ -2034,10 +2025,9 @@ if test -n "$submachine"; then
libc_cv_cc_submachine, [dnl
libc_cv_cc_submachine=no
for opt in "-march=$submachine" "-mcpu=$submachine"; do
- if AC_TRY_COMMAND([${CC-cc} $opt -xc /dev/null -S -o /dev/null]); then
+ LIBC_TRY_CC_OPTION([$opt], [
libc_cv_cc_submachine="$opt"
- break
- fi
+ break], [])
done])
if test "x$libc_cv_cc_submachine" = xno; then
AC_MSG_ERROR([${CC-cc} does not support $submachine])
@@ -2174,6 +2164,7 @@ AC_SUBST(libc_cv_cc_sse2avx)
AC_SUBST(libc_cv_cc_novzeroupper)
AC_SUBST(libc_cv_cc_fma4)
AC_SUBST(libc_cv_as_i686)
+AC_SUBST(libc_cv_sparc_as_vis3)
AC_SUBST(use_ldconfig)
AC_SUBST(ldd_rewrite_script)
diff --git a/libc/conform/conformtest.pl b/libc/conform/conformtest.pl
index 6a780203c..83650c245 100644
--- a/libc/conform/conformtest.pl
+++ b/libc/conform/conformtest.pl
@@ -3,11 +3,11 @@
use Getopt::Long;
use POSIX;
+$standard = "XOPEN2K8";
$CC = "gcc";
-
-$standard="XOPEN2K8";
+$tmpdir = "/tmp";
GetOptions ('headers=s' => \@headers, 'standard=s' => \$standard,
- 'flags=s' => \$flags, 'cc=s' => \$CC);
+ 'flags=s' => \$flags, 'cc=s' => \$CC, 'tmpdir=s' => \$tmpdir);
@headers = split(/,/,join(',',@headers));
# List of the headers we are testing.
@@ -84,11 +84,6 @@ while ($#knownproblems >= 0) {
$isknown{pop (@knownproblems)} = 1;
}
-$uid = getuid();
-($pwname,$pwpasswd,$pwuid,$pwgid,
- $pwquota,$pwcomment,$pwgcos,$pwdir,$pwshell,$pwexpire) = getpwuid($uid);
-$tmpdir = "$pwdir";
-
$verbose = 1;
$total = 0;
diff --git a/libc/conform/run-conformtest.sh b/libc/conform/run-conformtest.sh
index d83aa799d..c82fbcb5a 100644
--- a/libc/conform/run-conformtest.sh
+++ b/libc/conform/run-conformtest.sh
@@ -5,6 +5,9 @@ perl="$2"
cc="$3"
includes="$4"
+scratch=${objpfx}scratch
+mkdir -p "$scratch"
+
standards=("ISO" "ISO99" "ISO11" "POSIX" "XPG3" "XPG4" "UNIX98"
"XOPEN2K" "XOPEN2K8" "POSIX2008")
@@ -13,7 +16,7 @@ exitval=0
for s in ${standards[*]}; do
echo -n $s...
e=0
- if ! $perl conformtest.pl --cc="$cc" --flags="$includes" --standard=$s > ${objpfx}conform-$s.out; then
+ if ! $perl conformtest.pl --tmpdir="$scratch" --cc="$cc" --flags="$includes" --standard=$s > ${objpfx}conform-$s.out; then
e=1
fi
printf "\n%s\n" $s >> ${objpfx}run-conformtest.out
diff --git a/libc/debug/backtracesymsfd.c b/libc/debug/backtracesymsfd.c
index fe247d8cc..2345853d8 100644
--- a/libc/debug/backtracesymsfd.c
+++ b/libc/debug/backtracesymsfd.c
@@ -21,7 +21,7 @@
#include <string.h>
#include <sys/uio.h>
-#include <stdio-common/_itoa.h>
+#include <_itoa.h>
#include <not-cancel.h>
#if __ELF_NATIVE_CLASS == 32
diff --git a/libc/debug/segfault.c b/libc/debug/segfault.c
index 332550dc6..26e7348fd 100644
--- a/libc/debug/segfault.c
+++ b/libc/debug/segfault.c
@@ -29,7 +29,7 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#include <stdio-common/_itoa.h>
+#include <_itoa.h>
#include <ldsodefs.h>
#include <gnu/option-groups.h>
diff --git a/libc/elf/cache.c b/libc/elf/cache.c
index dadab9132..db8b9fa2f 100644
--- a/libc/elf/cache.c
+++ b/libc/elf/cache.c
@@ -90,6 +90,10 @@ print_entry (const char *lib, int flag, unsigned int osversion,
break;
case FLAG_MIPS64_LIBN64:
fputs (",64bit", stdout);
+ break;
+ case FLAG_X8664_LIBX32:
+ fputs (",x32", stdout);
+ break;
case 0:
break;
default:
diff --git a/libc/elf/dl-cache.c b/libc/elf/dl-cache.c
index b57a60028..c1bd1356f 100644
--- a/libc/elf/dl-cache.c
+++ b/libc/elf/dl-cache.c
@@ -24,7 +24,7 @@
#include <dl-cache.h>
#include <dl-procinfo.h>
-#include <stdio-common/_itoa.h>
+#include <_itoa.h>
#ifndef _DL_PLATFORMS_COUNT
# define _DL_PLATFORMS_COUNT 0
diff --git a/libc/elf/dl-minimal.c b/libc/elf/dl-minimal.c
index 3a984afb1..316de99b8 100644
--- a/libc/elf/dl-minimal.c
+++ b/libc/elf/dl-minimal.c
@@ -26,7 +26,7 @@
#include <sys/param.h>
#include <sys/types.h>
#include <ldsodefs.h>
-#include <stdio-common/_itoa.h>
+#include <_itoa.h>
#include <assert.h>
diff --git a/libc/elf/dl-misc.c b/libc/elf/dl-misc.c
index 9bf642daa..22fbba38d 100644
--- a/libc/elf/dl-misc.c
+++ b/libc/elf/dl-misc.c
@@ -30,7 +30,7 @@
#include <sys/stat.h>
#include <sys/uio.h>
#include <sysdep.h>
-#include <stdio-common/_itoa.h>
+#include <_itoa.h>
#include <bits/libc-lock.h>
/* Read the whole contents of FILE into new mmap'd space with given
diff --git a/libc/elf/dl-sysdep.c b/libc/elf/dl-sysdep.c
index 0920cc155..1cb4460a0 100644
--- a/libc/elf/dl-sysdep.c
+++ b/libc/elf/dl-sysdep.c
@@ -29,7 +29,7 @@
#include <sys/stat.h>
#include <sys/mman.h>
#include <ldsodefs.h>
-#include <stdio-common/_itoa.h>
+#include <_itoa.h>
#include <fpu_control.h>
#include <entry.h>
diff --git a/libc/elf/dl-version.c b/libc/elf/dl-version.c
index 3b1297545..047db2f82 100644
--- a/libc/elf/dl-version.c
+++ b/libc/elf/dl-version.c
@@ -23,7 +23,7 @@
#include <stdlib.h>
#include <string.h>
#include <ldsodefs.h>
-#include <stdio-common/_itoa.h>
+#include <_itoa.h>
#include <assert.h>
diff --git a/libc/elf/rtld.c b/libc/elf/rtld.c
index 8fbeaf661..7fb5dc615 100644
--- a/libc/elf/rtld.c
+++ b/libc/elf/rtld.c
@@ -28,7 +28,7 @@
#include <sys/param.h>
#include <sys/stat.h>
#include <ldsodefs.h>
-#include <stdio-common/_itoa.h>
+#include <_itoa.h>
#include <entry.h>
#include <fpu_control.h>
#include <hp-timing.h>
diff --git a/libc/elf/sotruss-lib.c b/libc/elf/sotruss-lib.c
index 542672692..c2ab7330d 100644
--- a/libc/elf/sotruss-lib.c
+++ b/libc/elf/sotruss-lib.c
@@ -1,5 +1,5 @@
/* Trace calls through PLTs and show caller, callee, and parameters.
- Copyright (C) 2011 Free Software Foundation, Inc.
+ Copyright (C) 2011, 2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
@@ -288,6 +288,40 @@ la_x86_64_gnu_pltenter (Elf64_Sym *sym __attribute__ ((unused)),
return sym->st_value;
}
+#elif defined __sparc__ && !defined __arch64__
+Elf32_Addr
+la_sparc32_gnu_pltenter (Elf32_Sym *sym __attribute__ ((unused)),
+ unsigned int ndx __attribute__ ((unused)),
+ uintptr_t *refcook, uintptr_t *defcook,
+ La_sparc32_regs *regs, unsigned int *flags,
+ const char *symname, long int *framesizep)
+{
+ print_enter (refcook, defcook, symname,
+ regs->lr_reg[0], regs->lr_reg[1], regs->lr_reg[2],
+ *flags);
+
+ /* No need to copy anything, we will not need the parameters in any case. */
+ *framesizep = 0;
+
+ return sym->st_value;
+}
+#elif defined __sparc__ && defined __arch64__
+Elf64_Addr
+la_sparc64_gnu_pltenter (Elf64_Sym *sym __attribute__ ((unused)),
+ unsigned int ndx __attribute__ ((unused)),
+ uintptr_t *refcook, uintptr_t *defcook,
+ La_sparc64_regs *regs, unsigned int *flags,
+ const char *symname, long int *framesizep)
+{
+ print_enter (refcook, defcook, symname,
+ regs->lr_reg[0], regs->lr_reg[1], regs->lr_reg[2],
+ *flags);
+
+ /* No need to copy anything, we will not need the parameters in any case. */
+ *framesizep = 0;
+
+ return sym->st_value;
+}
#elif !defined HAVE_ARCH_PLTENTER
# warning "pltenter for architecture not supported"
#endif
@@ -302,7 +336,7 @@ print_exit (uintptr_t *refcook, uintptr_t *defcook, const char *symname,
if (print_pid)
snprintf (buf, sizeof (buf), "%5ld: ", (long int) getpid ());
- fprintf (out_file, "%s%15s -> %-15s:%s%s - 0x%lu\n",
+ fprintf (out_file, "%s%15s -> %-15s:%s%s - 0x%lx\n",
buf, (char *) *refcook, (char *) *defcook, " ", symname, reg);
}
@@ -327,6 +361,26 @@ la_x86_64_gnu_pltexit (Elf64_Sym *sym, unsigned int ndx, uintptr_t *refcook,
return 0;
}
+#elif defined __sparc__ && !defined __arch64__
+unsigned int
+la_sparc32_gnu_pltexit (Elf32_Sym *sym, unsigned int ndx, uintptr_t *refcook,
+ uintptr_t *defcook, const struct La_sparc32_regs *inregs,
+ struct La_sparc32_retval *outregs, const char *symname)
+{
+ print_exit (refcook, defcook, symname, outregs->lrv_reg[0]);
+
+ return 0;
+}
+#elif defined __sparc__ && defined __arch64__
+unsigned int
+la_sparc64_gnu_pltexit (Elf64_Sym *sym, unsigned int ndx, uintptr_t *refcook,
+ uintptr_t *defcook, const struct La_sparc64_regs *inregs,
+ struct La_sparc64_retval *outregs, const char *symname)
+{
+ print_exit (refcook, defcook, symname, outregs->lrv_reg[0]);
+
+ return 0;
+}
#elif !defined HAVE_ARCH_PLTEXIT
# warning "pltexit for architecture not supported"
#endif
diff --git a/libc/hurd/hurdsock.c b/libc/hurd/hurdsock.c
index 170a3f618..f3611ecf2 100644
--- a/libc/hurd/hurdsock.c
+++ b/libc/hurd/hurdsock.c
@@ -22,7 +22,7 @@
#include <string.h>
#include <hurd/paths.h>
#include <stdio.h>
-#include "stdio-common/_itoa.h"
+#include <_itoa.h>
#include <cthreads.h> /* For `struct mutex'. */
#include "hurdmalloc.h" /* XXX */
diff --git a/libc/hurd/lookup-retry.c b/libc/hurd/lookup-retry.c
index c65eb5ad5..3c506a043 100644
--- a/libc/hurd/lookup-retry.c
+++ b/libc/hurd/lookup-retry.c
@@ -24,7 +24,7 @@
#include <limits.h>
#include <fcntl.h>
#include <string.h>
-#include "stdio-common/_itoa.h"
+#include <_itoa.h>
/* Translate the error from dir_lookup into the error the user sees. */
static inline error_t
diff --git a/libc/malloc/malloc.c b/libc/malloc/malloc.c
index d7d79e03f..79cdc5233 100644
--- a/libc/malloc/malloc.c
+++ b/libc/malloc/malloc.c
@@ -218,7 +218,7 @@
#include <malloc-machine.h>
#include <atomic.h>
-#include <stdio-common/_itoa.h>
+#include <_itoa.h>
#include <bits/wordsize.h>
#include <sys/sysinfo.h>
diff --git a/libc/malloc/mtrace.c b/libc/malloc/mtrace.c
index 67e3e4433..e299a1623 100644
--- a/libc/malloc/mtrace.c
+++ b/libc/malloc/mtrace.c
@@ -31,7 +31,7 @@
#include <string.h>
#include <stdlib.h>
-#include <stdio-common/_itoa.h>
+#include <_itoa.h>
#include <libc-internal.h>
diff --git a/libc/manual/creature.texi b/libc/manual/creature.texi
index cc09e3389..1bf53147e 100644
--- a/libc/manual/creature.texi
+++ b/libc/manual/creature.texi
@@ -1,6 +1,5 @@
@node Feature Test Macros
@subsection Feature Test Macros
-@include macros.texi
@cindex feature test macros
The exact set of features available when you compile a source file
diff --git a/libc/manual/intro.texi b/libc/manual/intro.texi
index 4a709edf7..deaf089b1 100644
--- a/libc/manual/intro.texi
+++ b/libc/manual/intro.texi
@@ -548,7 +548,6 @@ The header file @file{termios.h} reserves names prefixed with @samp{c_},
@end itemize
@comment Include the section on Creature Nest Macros.
-@comment It is in a separate file so it can be formatted into ../NOTES.
@include creature.texi
@node Roadmap to the Manual, , Using the Library, Introduction
diff --git a/libc/manual/lang.texi b/libc/manual/lang.texi
index 6cb7371aa..baaccaa30 100644
--- a/libc/manual/lang.texi
+++ b/libc/manual/lang.texi
@@ -229,7 +229,6 @@ additional variable arguments. @xref{Calling Variadics}.
variable arguments functions.
* Argument Macros:: Detailed specification of the macros
for accessing variable arguments.
-* Old Varargs:: The pre-ISO way of defining variadic functions.
@end menu
@node Variadic Prototypes
@@ -427,9 +426,6 @@ The type @code{va_list} is used for argument pointer variables.
This macro initializes the argument pointer variable @var{ap} to point
to the first of the optional arguments of the current function;
@var{last-required} must be the last required argument to the function.
-
-@xref{Old Varargs}, for an alternate definition of @code{va_start}
-found in the header file @file{varargs.h}.
@end deftypefn
@comment stdarg.h
@@ -511,68 +507,6 @@ arguments facility.
@include add.c.texi
@end smallexample
-@node Old Varargs
-@subsubsection Old-Style Variadic Functions
-
-@pindex varargs.h
-Before @w{ISO C}, programmers used a slightly different facility for
-writing variadic functions. The GNU C compiler still supports it;
-currently, it is more portable than the @w{ISO C} facility, since support
-for @w{ISO C} is still not universal. The header file which defines the
-old-fashioned variadic facility is called @file{varargs.h}.
-
-Using @file{varargs.h} is almost the same as using @file{stdarg.h}.
-There is no difference in how you call a variadic function;
-see @ref{Calling Variadics}. The only difference is in how you define
-them. First of all, you must use old-style non-prototype syntax, like
-this:
-
-@smallexample
-tree
-build (va_alist)
- va_dcl
-@{
-@end smallexample
-
-Secondly, you must give @code{va_start} only one argument, like this:
-
-@smallexample
- va_list p;
- va_start (p);
-@end smallexample
-
-These are the special macros used for defining old-style variadic
-functions:
-
-@comment varargs.h
-@comment Unix
-@deffn Macro va_alist
-This macro stands for the argument name list required in a variadic
-function.
-@end deffn
-
-@comment varargs.h
-@comment Unix
-@deffn Macro va_dcl
-This macro declares the implicit argument or arguments for a variadic
-function.
-@end deffn
-
-@comment varargs.h
-@comment Unix
-@deftypefn {Macro} void va_start (va_list @var{ap})
-This macro, as defined in @file{varargs.h}, initializes the argument
-pointer variable @var{ap} to point to the first argument of the current
-function.
-@end deftypefn
-
-The other argument macros, @code{va_arg} and @code{va_end}, are the same
-in @file{varargs.h} as in @file{stdarg.h}; see @ref{Argument Macros}, for
-details.
-
-It does not work to include both @file{varargs.h} and @file{stdarg.h} in
-the same compilation; they define @code{va_start} in conflicting ways.
-
@node Null Pointer Constant
@section Null Pointer Constant
@cindex null pointer constant
diff --git a/libc/manual/llio.texi b/libc/manual/llio.texi
index d75fe7150..b33909fac 100644
--- a/libc/manual/llio.texi
+++ b/libc/manual/llio.texi
@@ -1458,7 +1458,7 @@ This corresponds with BSD's @code{MADV_DONTNEED}.
@end table
-@code{msync} returns @math{0} for success and @math{-1} for
+@code{madvise} returns @math{0} for success and @math{-1} for
error. Errors include:
@table @code
diff --git a/libc/math/gen-libm-test.pl b/libc/math/gen-libm-test.pl
index 2fe03b994..ae00427a0 100755
--- a/libc/math/gen-libm-test.pl
+++ b/libc/math/gen-libm-test.pl
@@ -1,5 +1,5 @@
#!/usr/bin/perl -w
-# Copyright (C) 1999, 2006 Free Software Foundation, Inc.
+# Copyright (C) 1999-2012 Free Software Foundation, Inc.
# This file is part of the GNU C Library.
# Contributed by Andreas Jaeger <aj@suse.de>, 1999.
@@ -78,8 +78,10 @@ use vars qw ($output_dir $ulps_file $default_ulp);
"M_SQRT_PIl" => "sqrt (pi)",
"INVALID_EXCEPTION" => "invalid exception",
"DIVIDE_BY_ZERO_EXCEPTION" => "division by zero exception",
+ "OVERFLOW_EXCEPTION" => "overflow exception",
"INVALID_EXCEPTION_OK" => "invalid exception allowed",
"DIVIDE_BY_ZERO_EXCEPTION_OK" => "division by zero exception allowed",
+ "OVERFLOW_EXCEPTION_OK" => "overflow exception allowed",
"EXCEPTIONS_OK" => "exceptions allowed",
"IGNORE_ZERO_INF_SIGN" => "sign of zero/inf not specified",
"INVALID_EXCEPTION|IGNORE_ZERO_INF_SIGN" => "invalid exception and sign of zero/inf not specified"
diff --git a/libc/math/libm-test.inc b/libc/math/libm-test.inc
index 56928978e..45e61e86a 100644
--- a/libc/math/libm-test.inc
+++ b/libc/math/libm-test.inc
@@ -78,8 +78,8 @@
against. These implemented tests should check all cases that are
specified in ISO C99.
- Exception testing: At the moment only divide-by-zero and invalid
- exceptions are tested. Overflow/underflow and inexact exceptions
+ Exception testing: At the moment only divide-by-zero, invalid and
+ overflow exceptions are tested. Underflow and inexact exceptions
aren't checked at the moment.
NaN values: There exist signalling and quiet NaNs. This implementation
@@ -133,12 +133,14 @@
#define NO_EXCEPTION 0x0
#define INVALID_EXCEPTION 0x1
#define DIVIDE_BY_ZERO_EXCEPTION 0x2
+#define OVERFLOW_EXCEPTION 0x4
/* The next flags signals that those exceptions are allowed but not required. */
-#define INVALID_EXCEPTION_OK 0x4
-#define DIVIDE_BY_ZERO_EXCEPTION_OK 0x8
+#define INVALID_EXCEPTION_OK 0x8
+#define DIVIDE_BY_ZERO_EXCEPTION_OK 0x10
+#define OVERFLOW_EXCEPTION_OK 0x20
#define EXCEPTIONS_OK INVALID_EXCEPTION_OK+DIVIDE_BY_ZERO_EXCEPTION_OK
/* Some special test flags, passed togther with exceptions. */
-#define IGNORE_ZERO_INF_SIGN 0x10
+#define IGNORE_ZERO_INF_SIGN 0x40
/* Various constants (we must supply them precalculated for accuracy). */
#define M_PI_6l .52359877559829887307710723054658383L
@@ -459,6 +461,11 @@ test_exceptions (const char *test_name, int exception)
test_single_exception (test_name, exception, INVALID_EXCEPTION, FE_INVALID,
"Invalid operation");
#endif
+#ifdef FE_OVERFLOW
+ if ((exception & OVERFLOW_EXCEPTION_OK) == 0)
+ test_single_exception (test_name, exception, OVERFLOW_EXCEPTION,
+ FE_OVERFLOW, "Overflow");
+#endif
feclearexcept (FE_ALL_EXCEPT);
}
@@ -957,6 +964,8 @@ atan2_test (void)
TEST_ff_f (atan2, minus_infty, minus_infty, -M_PI_34l);
TEST_ff_f (atan2, nan_value, nan_value, nan_value);
+ TEST_ff_f (atan2, max_value, max_value, M_PI_4l);
+
TEST_ff_f (atan2, 0.75L, 1, 0.643501108793284386802809228717322638L);
TEST_ff_f (atan2, -0.75L, 1.0L, -0.643501108793284386802809228717322638L);
TEST_ff_f (atan2, 0.75L, -1.0L, 2.49809154479650885165983415456218025L);
@@ -1893,6 +1902,21 @@ cexp_test (void)
TEST_c_c (cexp, 0.75L, 1.25L, 0.667537446429131586942201977015932112L, 2.00900045494094876258347228145863909L);
TEST_c_c (cexp, -2.0, -3.0, -0.13398091492954261346140525546115575L, -0.019098516261135196432576240858800925L);
+ TEST_c_c (cexp, 0, 0x1p65, 0.99888622066058013610642172179340364209972L, -0.047183876212354673805106149805700013943218L);
+ TEST_c_c (cexp, 0, -0x1p65, 0.99888622066058013610642172179340364209972L, 0.047183876212354673805106149805700013943218L);
+ TEST_c_c (cexp, 50, 0x1p127, 4.053997150228616856622417636046265337193e21L, 3.232070315463388524466674772633810238819e21L);
+
+#ifndef TEST_FLOAT
+ TEST_c_c (cexp, 0, 1e22, 0.5232147853951389454975944733847094921409L, -0.8522008497671888017727058937530293682618L);
+ TEST_c_c (cexp, 0, 0x1p1023, -0.826369834614147994500785680811743734805L, 0.5631277798508840134529434079444683477104L);
+ TEST_c_c (cexp, 500, 0x1p1023, -1.159886268932754433233243794561351783426e217L, 7.904017694554466595359379965081774849708e216L);
+#endif
+
+#if defined TEST_LDOUBLE && LDBL_MAX_EXP >= 16384
+ TEST_c_c (cexp, 0, 0x1p16383L, 0.9210843909921906206874509522505756251609L, 0.3893629985894208126948115852610595405563L);
+ TEST_c_c (cexp, -10000, 0x1p16383L, 1.045876464564882298442774542991176546722e-4343L, 4.421154026488516836023811173959413420548e-4344L);
+#endif
+
END (cexp, complex);
}
@@ -1975,6 +1999,24 @@ clog_test (void)
TEST_c_c (clog, 0.75L, 1.25L, 0.376885901188190075998919126749298416L, 1.03037682652431246378774332703115153L);
TEST_c_c (clog, -2, -3, 1.2824746787307683680267437207826593L, -2.1587989303424641704769327722648368L);
+ TEST_c_c (clog, 0x1.fffffep+127L, 0x1.fffffep+127L, 89.06941264234832570836679262104313101776L, M_PI_4l);
+ TEST_c_c (clog, 0x1.fffffep+127L, 1.0L, 88.72283905206835305365817656031404273372L, 2.938736052218037251011746307725933020145e-39L);
+ TEST_c_c (clog, 0x1p-149L, 0x1p-149L, -102.9323563131518784484589700365392203592L, M_PI_4l);
+ TEST_c_c (clog, 0x1p-147L, 0x1p-147L, -101.5460619520319878296245057936228672231L, M_PI_4l);
+
+#ifndef TEST_FLOAT
+ TEST_c_c (clog, 0x1.fffffffffffffp+1023L, 0x1.fffffffffffffp+1023L, 710.1292864836639693869320059713862337880L, M_PI_4l);
+ TEST_c_c (clog, 0x1.fffffffffffffp+1023L, 0x1p+1023L, 709.8942846690411016323109979483151967689L, 0.4636476090008061606231772164674799632783L);
+ TEST_c_c (clog, 0x1p-1074L, 0x1p-1074L, -744.0934983311012896593986823853525458290L, M_PI_4l);
+ TEST_c_c (clog, 0x1p-1073L, 0x1p-1073L, -743.4003511505413443499814502638943692610L, M_PI_4l);
+#endif
+
+#if defined TEST_LDOUBLE && LDBL_MAX_EXP >= 16384
+ TEST_c_c (clog, 0x1.fp+16383L, 0x1.fp+16383L, 11356.83823118610934184548269774874545400L, M_PI_4l);
+ TEST_c_c (clog, 0x1.fp+16383L, 0x1p+16383L, 11356.60974243783798653123798337822335902L, 0.4764674194737066993385333770295162295856L);
+ TEST_c_c (clog, 0x1p-16440L, 0x1p-16441L, -11395.22807662984378194141292922726786191L, 0.4636476090008061162142562314612144020285L);
+#endif
+
END (clog, complex);
}
@@ -2041,6 +2083,24 @@ clog10_test (void)
TEST_c_c (clog10, 0.75L, 1.25L, 0.163679467193165171449476605077428975L, 0.447486970040493067069984724340855636L);
TEST_c_c (clog10, -2, -3, 0.556971676153418384603252578971164214L, -0.937554462986374708541507952140189646L);
+ TEST_c_c (clog10, 0x1.fffffep+127L, 0x1.fffffep+127L, 38.68235441693561449174780668781319348761L, M_PI4_LOG10El);
+ TEST_c_c (clog10, 0x1.fffffep+127L, 1.0L, 38.53183941910362389414093724045094697423L, 1.276276851248440096917018665609900318458e-39L);
+ TEST_c_c (clog10, 0x1p-149L, 0x1p-149L, -44.70295435610120748924022586658721447508L, M_PI4_LOG10El);
+ TEST_c_c (clog10, 0x1p-147L, 0x1p-147L, -44.10089436477324509881274807713822842154L, M_PI4_LOG10El);
+
+#ifndef TEST_FLOAT
+ TEST_c_c (clog10, 0x1.fffffffffffffp+1023L, 0x1.fffffffffffffp+1023L, 308.4052305577487344482591243175787477115L, M_PI4_LOG10El);
+ TEST_c_c (clog10, 0x1.fffffffffffffp+1023L, 0x1p+1023L, 308.3031705664207720674749211936626341569L, 0.2013595981366865903254995612594728746470L);
+ TEST_c_c (clog10, 0x1p-1074L, 0x1p-1074L, -323.1557003452838130619487034867432642357L, M_PI4_LOG10El);
+ TEST_c_c (clog10, 0x1p-1073L, 0x1p-1073L, -322.8546703496198318667349645920187712089L, M_PI4_LOG10El);
+#endif
+
+#if defined TEST_LDOUBLE && LDBL_MAX_EXP >= 16384
+ TEST_c_c (clog10, 0x1.fp+16383L, 0x1.fp+16383L, 4932.212175672014259683102930239951947672L, M_PI4_LOG10El);
+ TEST_c_c (clog10, 0x1.fp+16383L, 0x1p+16383L, 4932.112944269463028900262609694408579449L, 0.2069271710841128115912940666587802677383L);
+ TEST_c_c (clog10, 0x1p-16440L, 0x1p-16441L, -4948.884673709346821106688037612752099609L, 0.2013595981366865710389502301937289472543L);
+#endif
+
END (clog10, complex);
}
@@ -2120,10 +2180,22 @@ cos_test (void)
TEST_f_f (cos, 0.75L, 0.731688868873820886311838753000084544L);
+ TEST_f_f (cos, 0x1p65, 0.99888622066058013610642172179340364209972L);
+ TEST_f_f (cos, -0x1p65, 0.99888622066058013610642172179340364209972L);
+
#ifdef TEST_DOUBLE
TEST_f_f (cos, 0.80190127184058835, 0.69534156199418473);
#endif
+#ifndef TEST_FLOAT
+ TEST_f_f (cos, 1e22, 0.5232147853951389454975944733847094921409L);
+ TEST_f_f (cos, 0x1p1023, -0.826369834614147994500785680811743734805L);
+#endif
+
+#if defined TEST_LDOUBLE && LDBL_MAX_EXP >= 16384
+ TEST_f_f (cos, 0x1p16383L, 0.9210843909921906206874509522505756251609L);
+#endif
+
END (cos);
}
@@ -2665,6 +2737,24 @@ csqrt_test (void)
part). */
TEST_c_c (csqrt, 0, -1, M_SQRT_2_2, -M_SQRT_2_2);
+ TEST_c_c (csqrt, 0x1.fffffep+127L, 0x1.fffffep+127L, 2.026714405498316804978751017492482558075e+19L, 8.394925938143272988211878516208015586281e+18L);
+ TEST_c_c (csqrt, 0x1.fffffep+127L, 1.0L, 1.844674352395372953599975585936590505260e+19L, 2.710505511993121390769065968615872097053e-20L);
+ TEST_c_c (csqrt, 0x1p-149L, 0x1p-149L, 4.112805464342778798097003462770175200803e-23L, 1.703579802732953750368659735601389709551e-23L);
+ TEST_c_c (csqrt, 0x1p-147L, 0x1p-147L, 8.225610928685557596194006925540350401606e-23L, 3.407159605465907500737319471202779419102e-23L);
+
+#ifndef TEST_FLOAT
+ TEST_c_c (csqrt, 0x1.fffffffffffffp+1023L, 0x1.fffffffffffffp+1023L, 1.473094556905565378990473658199034571917e+154L, 6.101757441282702188537080005372547713595e+153L);
+ TEST_c_c (csqrt, 0x1.fffffffffffffp+1023L, 0x1p+1023L, 1.379778091031440685006200821918878702861e+154L, 3.257214233483129514781233066898042490248e+153L);
+ TEST_c_c (csqrt, 0x1p-1074L, 0x1p-1074L, 2.442109726130830256743814843868934877597e-162L, 1.011554969366634726113090867589031782487e-162L);
+ TEST_c_c (csqrt, 0x1p-1073L, 0x1p-1073L, 3.453664695497464982856905711457966660085e-162L, 1.430554756764195530630723976279903095110e-162L);
+#endif
+
+#if defined TEST_LDOUBLE && LDBL_MAX_EXP >= 16384
+ TEST_c_c (csqrt, 0x1.fp+16383L, 0x1.fp+16383L, 1.179514222452201722651836720466795901016e+2466L, 4.885707879516577666702435054303191575148e+2465L);
+ TEST_c_c (csqrt, 0x1.fp+16383L, 0x1p+16383L, 1.106698967236475180613254276996359485630e+2466L, 2.687568007603946993388538156299100955642e+2465L);
+ TEST_c_c (csqrt, 0x1p-16440L, 0x1p-16441L, 3.514690655930285351254618340783294558136e-2475L, 8.297059146828716918029689466551384219370e-2476L);
+#endif
+
END (csqrt, complex);
}
@@ -3019,7 +3109,7 @@ exp10_test (void)
TEST_f_f (exp10, nan_value, nan_value);
TEST_f_f (exp10, 3, 1000);
TEST_f_f (exp10, -1, 0.1L);
- TEST_f_f (exp10, 1e6, plus_infty);
+ TEST_f_f (exp10, 1e6, plus_infty, OVERFLOW_EXCEPTION);
TEST_f_f (exp10, -1e6, 0);
TEST_f_f (exp10, 0.75L, 5.62341325190349080394951039776481231L);
@@ -3046,7 +3136,7 @@ exp2_test (void)
TEST_f_f (exp2, 10, 1024);
TEST_f_f (exp2, -1, 0.5);
- TEST_f_f (exp2, 1e6, plus_infty);
+ TEST_f_f (exp2, 1e6, plus_infty, OVERFLOW_EXCEPTION);
TEST_f_f (exp2, -1e6, 0);
TEST_f_f (exp2, 0.75L, 1.68179283050742908606225095246642979L);
@@ -3082,7 +3172,8 @@ expm1_test (void)
#endif
errno = 0;
- TEST_f_f (expm1, 100000.0, plus_infty);
+ /* Bug 13787: OVERFLOW exception may be missing. */
+ TEST_f_f (expm1, 100000.0, plus_infty, OVERFLOW_EXCEPTION_OK);
check_int ("errno for expm1(large) == ERANGE", errno, ERANGE, 0, 0, 0);
END (expm1);
@@ -3570,6 +3661,19 @@ hypot_test (void)
TEST_ff_f (hypot, 0.75L, 1.25L, 1.45773797371132511771853821938639577L);
+#if !(defined TEST_FLOAT && defined TEST_INLINE)
+ TEST_ff_f (hypot, 0x3p125L, 0x4p125L, 0x5p125L);
+ TEST_ff_f (hypot, 0x1.234566p-126L, 0x1.234566p-126L, 1.891441686191081936598531534017449451173e-38L);
+#endif
+
+#ifndef TEST_FLOAT
+ TEST_ff_f (hypot, 0x3p1021L, 0x4p1021L, 0x5p1021L);
+#endif
+
+#if defined TEST_LDOUBLE && LDBL_MAX_EXP >= 16384 && !defined TEST_INLINE
+ TEST_ff_f (hypot, 0x3p16381L, 0x4p16381L, 0x5p16381L);
+#endif
+
END (hypot);
}
@@ -3656,6 +3760,12 @@ j0_test (void)
TEST_f_f (j0, 4.0, -3.9714980986384737228659076845169804197562E-1L);
TEST_f_f (j0, -4.0, -3.9714980986384737228659076845169804197562E-1L);
+ TEST_f_f (j0, 0x1.d7ce3ap+107L, 2.775523647291230802651040996274861694514e-17L);
+
+#ifndef TEST_FLOAT
+ TEST_f_f (j0, -0x1.001000001p+593L, -3.927269966354206207832593635798954916263e-90L);
+#endif
+
END (j0);
}
@@ -3691,6 +3801,12 @@ j1_test (void)
TEST_f_f (j1, 8.0, 0.234636346853914624381276651590454612L);
TEST_f_f (j1, 10.0, 0.0434727461688614366697487680258592883L);
+ TEST_f_f (j1, 0x1.3ffp+74L, 1.818984347516051243459364437186082741567e-12L);
+
+#ifndef TEST_FLOAT
+ TEST_f_f (j1, 0x1.ff00000000002p+840L, 1.846591691699331493194965158699937660696e-127L);
+#endif
+
END (j1);
}
@@ -3771,7 +3887,9 @@ jn_test (void)
TEST_ff_f (jn, 6, 2.4048255576957729L, 0.34048184720278336646673682895929161E-2L);
TEST_ff_f (jn, 7, 2.4048255576957729L, 0.60068836573295394221291569249883076E-3L);
TEST_ff_f (jn, 8, 2.4048255576957729L, 0.92165786705344923232879022467054148E-4L);
- TEST_ff_f (jn, 9, 2.4048255576957729L, 0.12517270977961513005428966643852564E-4L)
+ TEST_ff_f (jn, 9, 2.4048255576957729L, 0.12517270977961513005428966643852564E-4L);
+
+ TEST_ff_f (jn, 2, 0x1.ffff62p+99L, -4.43860668048170034334926693188979974489e-16L);
END (jn);
}
@@ -5160,8 +5278,8 @@ nextafter_test (void)
FLOAT fltmax = CHOOSE (LDBL_MAX, DBL_MAX, FLT_MAX,
LDBL_MAX, DBL_MAX, FLT_MAX);
- TEST_ff_f (nextafter, fltmax, plus_infty, plus_infty);
- TEST_ff_f (nextafter, -fltmax, minus_infty, minus_infty);
+ TEST_ff_f (nextafter, fltmax, plus_infty, plus_infty, OVERFLOW_EXCEPTION);
+ TEST_ff_f (nextafter, -fltmax, minus_infty, minus_infty, OVERFLOW_EXCEPTION);
#ifdef TEST_LDOUBLE
// XXX Enable once gcc is fixed.
@@ -5340,11 +5458,75 @@ pow_test (void)
TEST_ff_f (pow, 0, -11, plus_infty, DIVIDE_BY_ZERO_EXCEPTION);
check_int ("errno for pow(0,-odd) == ERANGE", errno, ERANGE, 0, 0, 0);
errno = 0;
+ TEST_ff_f (pow, 0, -0xffffff, plus_infty, DIVIDE_BY_ZERO_EXCEPTION);
+ check_int ("errno for pow(0,-odd) == ERANGE", errno, ERANGE, 0, 0, 0);
+#ifndef TEST_FLOAT
+ errno = 0;
+ TEST_ff_f (pow, 0, -0x1.fffffffffffffp+52L, plus_infty, DIVIDE_BY_ZERO_EXCEPTION);
+ check_int ("errno for pow(0,-odd) == ERANGE", errno, ERANGE, 0, 0, 0);
+#endif
+#ifdef TEST_LDOUBLE
+# if LDBL_MANT_DIG >= 64
+ errno = 0;
+ TEST_ff_f (pow, 0, -0x1.fffffffffffffffep+63L, plus_infty, DIVIDE_BY_ZERO_EXCEPTION);
+ check_int ("errno for pow(0,-odd) == ERANGE", errno, ERANGE, 0, 0, 0);
+# endif
+# if LDBL_MANT_DIG >= 106
+ errno = 0;
+ TEST_ff_f (pow, 0, -0x1.ffffffffffffffffffffffffff8p+105L, plus_infty, DIVIDE_BY_ZERO_EXCEPTION);
+ check_int ("errno for pow(0,-odd) == ERANGE", errno, ERANGE, 0, 0, 0);
+# endif
+# if LDBL_MANT_DIG >= 113
+ errno = 0;
+ TEST_ff_f (pow, 0, -0x1.ffffffffffffffffffffffffffffp+112L, plus_infty, DIVIDE_BY_ZERO_EXCEPTION);
+ check_int ("errno for pow(0,-odd) == ERANGE", errno, ERANGE, 0, 0, 0);
+# endif
+#endif
TEST_ff_f (pow, minus_zero, -1, minus_infty, DIVIDE_BY_ZERO_EXCEPTION);
check_int ("errno for pow(-0,-odd) == ERANGE", errno, ERANGE, 0, 0, 0);
errno = 0;
TEST_ff_f (pow, minus_zero, -11L, minus_infty, DIVIDE_BY_ZERO_EXCEPTION);
check_int ("errno for pow(-0,-odd) == ERANGE", errno, ERANGE, 0, 0, 0);
+ errno = 0;
+ TEST_ff_f (pow, minus_zero, -0xffffff, minus_infty, DIVIDE_BY_ZERO_EXCEPTION);
+ check_int ("errno for pow(-0,-odd) == ERANGE", errno, ERANGE, 0, 0, 0);
+ errno = 0;
+ TEST_ff_f (pow, minus_zero, -0x1fffffe, plus_infty, DIVIDE_BY_ZERO_EXCEPTION);
+ check_int ("errno for pow(-0,-even) == ERANGE", errno, ERANGE, 0, 0, 0);
+#ifndef TEST_FLOAT
+ errno = 0;
+ TEST_ff_f (pow, minus_zero, -0x1.fffffffffffffp+52L, minus_infty, DIVIDE_BY_ZERO_EXCEPTION);
+ check_int ("errno for pow(-0,-odd) == ERANGE", errno, ERANGE, 0, 0, 0);
+ errno = 0;
+ TEST_ff_f (pow, minus_zero, -0x1.fffffffffffffp+53L, plus_infty, DIVIDE_BY_ZERO_EXCEPTION);
+ check_int ("errno for pow(-0,-even) == ERANGE", errno, ERANGE, 0, 0, 0);
+#endif
+#ifdef TEST_LDOUBLE
+# if LDBL_MANT_DIG >= 64
+ errno = 0;
+ TEST_ff_f (pow, minus_zero, -0x1.fffffffffffffffep+63L, minus_infty, DIVIDE_BY_ZERO_EXCEPTION);
+ check_int ("errno for pow(-0,-odd) == ERANGE", errno, ERANGE, 0, 0, 0);
+ errno = 0;
+ TEST_ff_f (pow, minus_zero, -0x1.fffffffffffffffep+64L, plus_infty, DIVIDE_BY_ZERO_EXCEPTION);
+ check_int ("errno for pow(-0,-even) == ERANGE", errno, ERANGE, 0, 0, 0);
+# endif
+# if LDBL_MANT_DIG >= 106
+ errno = 0;
+ TEST_ff_f (pow, minus_zero, -0x1.ffffffffffffffffffffffffff8p+105L, minus_infty, DIVIDE_BY_ZERO_EXCEPTION);
+ check_int ("errno for pow(-0,-odd) == ERANGE", errno, ERANGE, 0, 0, 0);
+ errno = 0;
+ TEST_ff_f (pow, minus_zero, -0x1.ffffffffffffffffffffffffff8p+106L, plus_infty, DIVIDE_BY_ZERO_EXCEPTION);
+ check_int ("errno for pow(-0,-even) == ERANGE", errno, ERANGE, 0, 0, 0);
+# endif
+# if LDBL_MANT_DIG >= 113
+ errno = 0;
+ TEST_ff_f (pow, minus_zero, -0x1.ffffffffffffffffffffffffffffp+112L, minus_infty, DIVIDE_BY_ZERO_EXCEPTION);
+ check_int ("errno for pow(-0,-odd) == ERANGE", errno, ERANGE, 0, 0, 0);
+ errno = 0;
+ TEST_ff_f (pow, minus_zero, -0x1.ffffffffffffffffffffffffffffp+113L, plus_infty, DIVIDE_BY_ZERO_EXCEPTION);
+ check_int ("errno for pow(-0,-even) == ERANGE", errno, ERANGE, 0, 0, 0);
+# endif
+#endif
errno = 0;
TEST_ff_f (pow, 0, -2, plus_infty, DIVIDE_BY_ZERO_EXCEPTION);
@@ -5353,16 +5535,38 @@ pow_test (void)
TEST_ff_f (pow, 0, -11.1L, plus_infty, DIVIDE_BY_ZERO_EXCEPTION);
check_int ("errno for pow(0,-num) == ERANGE", errno, ERANGE, 0, 0, 0);
errno = 0;
+ TEST_ff_f (pow, 0, -0x1p24, plus_infty, DIVIDE_BY_ZERO_EXCEPTION);
+ check_int ("errno for pow(0,-num) == ERANGE", errno, ERANGE, 0, 0, 0);
+ errno = 0;
+ TEST_ff_f (pow, 0, -0x1p127, plus_infty, DIVIDE_BY_ZERO_EXCEPTION);
+ check_int ("errno for pow(0,-num) == ERANGE", errno, ERANGE, 0, 0, 0);
+ errno = 0;
+ /* Bug 13879: spurious OVERFLOW exception may be present. */
+ TEST_ff_f (pow, 0, -max_value, plus_infty, DIVIDE_BY_ZERO_EXCEPTION|OVERFLOW_EXCEPTION_OK);
+ check_int ("errno for pow(0,-num) == ERANGE", errno, ERANGE, 0, 0, 0);
+ errno = 0;
TEST_ff_f (pow, minus_zero, -2, plus_infty, DIVIDE_BY_ZERO_EXCEPTION);
check_int ("errno for pow(-0,-even) == ERANGE", errno, ERANGE, 0, 0, 0);
errno = 0;
TEST_ff_f (pow, minus_zero, -11.1L, plus_infty, DIVIDE_BY_ZERO_EXCEPTION);
check_int ("errno for pow(-0,-num) == ERANGE", errno, ERANGE, 0, 0, 0);
+ errno = 0;
+ TEST_ff_f (pow, minus_zero, -0x1p24, plus_infty, DIVIDE_BY_ZERO_EXCEPTION);
+ check_int ("errno for pow(-0,-num) == ERANGE", errno, ERANGE, 0, 0, 0);
+ errno = 0;
+ TEST_ff_f (pow, minus_zero, -0x1p127, plus_infty, DIVIDE_BY_ZERO_EXCEPTION);
+ check_int ("errno for pow(-0,-num) == ERANGE", errno, ERANGE, 0, 0, 0);
+ errno = 0;
+ /* Bug 13879: spurious OVERFLOW exception may be present. */
+ TEST_ff_f (pow, minus_zero, -max_value, plus_infty, DIVIDE_BY_ZERO_EXCEPTION|OVERFLOW_EXCEPTION_OK);
+ check_int ("errno for pow(-0,-num) == ERANGE", errno, ERANGE, 0, 0, 0);
- TEST_ff_f (pow, 0x1p72L, 0x1p72L, plus_infty);
+ TEST_ff_f (pow, 0x1p72L, 0x1p72L, plus_infty, OVERFLOW_EXCEPTION);
TEST_ff_f (pow, 10, -0x1p72L, 0);
- TEST_ff_f (pow, max_value, max_value, plus_infty);
- TEST_ff_f (pow, 10, -max_value, 0);
+ /* Bug 13873: OVERFLOW exception may be missing. */
+ TEST_ff_f (pow, max_value, max_value, plus_infty, OVERFLOW_EXCEPTION_OK);
+ /* Bug 13872: spurious OVERFLOW exception may be present. */
+ TEST_ff_f (pow, 10, -max_value, 0, OVERFLOW_EXCEPTION_OK);
TEST_ff_f (pow, 0, 1, 0);
TEST_ff_f (pow, 0, 11, 0);
@@ -5394,32 +5598,155 @@ pow_test (void)
/* pow (+inf, y) == +inf for y > 0. */
TEST_ff_f (pow, plus_infty, 2, plus_infty);
+ TEST_ff_f (pow, plus_infty, 0xffffff, plus_infty);
+#ifndef TEST_FLOAT
+ TEST_ff_f (pow, plus_infty, 0x1.fffffffffffffp+52L, plus_infty);
+#endif
+#ifdef TEST_LDOUBLE
+# if LDBL_MANT_DIG >= 64
+ TEST_ff_f (pow, plus_infty, 0x1.fffffffffffffffep+63L, plus_infty);
+# endif
+# if LDBL_MANT_DIG >= 106
+ TEST_ff_f (pow, plus_infty, 0x1.ffffffffffffffffffffffffff8p+105L, plus_infty);
+# endif
+# if LDBL_MANT_DIG >= 113
+ TEST_ff_f (pow, plus_infty, 0x1.ffffffffffffffffffffffffffffp+112L, plus_infty);
+# endif
+#endif
+ TEST_ff_f (pow, plus_infty, 0x1p24, plus_infty);
+ TEST_ff_f (pow, plus_infty, 0x1p127, plus_infty);
+ TEST_ff_f (pow, plus_infty, max_value, plus_infty);
/* pow (+inf, y) == +0 for y < 0. */
TEST_ff_f (pow, plus_infty, -1, 0.0);
+ TEST_ff_f (pow, plus_infty, -0xffffff, 0.0);
+#ifndef TEST_FLOAT
+ TEST_ff_f (pow, plus_infty, -0x1.fffffffffffffp+52L, 0.0);
+#endif
+#ifdef TEST_LDOUBLE
+# if LDBL_MANT_DIG >= 64
+ TEST_ff_f (pow, plus_infty, -0x1.fffffffffffffffep+63L, 0.0);
+# endif
+# if LDBL_MANT_DIG >= 106
+ TEST_ff_f (pow, plus_infty, -0x1.ffffffffffffffffffffffffff8p+105L, 0.0);
+# endif
+# if LDBL_MANT_DIG >= 113
+ TEST_ff_f (pow, plus_infty, -0x1.ffffffffffffffffffffffffffffp+112L, 0.0);
+# endif
+#endif
+ TEST_ff_f (pow, plus_infty, -0x1p24, 0.0);
+ TEST_ff_f (pow, plus_infty, -0x1p127, 0.0);
+ TEST_ff_f (pow, plus_infty, -max_value, 0.0);
/* pow (-inf, y) == -inf for y an odd integer > 0. */
TEST_ff_f (pow, minus_infty, 27, minus_infty);
+ TEST_ff_f (pow, minus_infty, 0xffffff, minus_infty);
+ TEST_ff_f (pow, minus_infty, 0x1fffffe, plus_infty);
+#ifndef TEST_FLOAT
+ TEST_ff_f (pow, minus_infty, 0x1.fffffffffffffp+52L, minus_infty);
+ TEST_ff_f (pow, minus_infty, 0x1.fffffffffffffp+53L, plus_infty);
+#endif
+#ifdef TEST_LDOUBLE
+# if LDBL_MANT_DIG >= 64
+ TEST_ff_f (pow, minus_infty, 0x1.fffffffffffffffep+63L, minus_infty);
+ TEST_ff_f (pow, minus_infty, 0x1.fffffffffffffffep+64L, plus_infty);
+# endif
+# if LDBL_MANT_DIG >= 106
+ TEST_ff_f (pow, minus_infty, 0x1.ffffffffffffffffffffffffff8p+105L, minus_infty);
+ TEST_ff_f (pow, minus_infty, 0x1.ffffffffffffffffffffffffff8p+106L, plus_infty);
+# endif
+# if LDBL_MANT_DIG >= 113
+ TEST_ff_f (pow, minus_infty, 0x1.ffffffffffffffffffffffffffffp+112L, minus_infty);
+ TEST_ff_f (pow, minus_infty, 0x1.ffffffffffffffffffffffffffffp+113L, plus_infty);
+# endif
+#endif
/* pow (-inf, y) == +inf for y > 0 and not an odd integer. */
TEST_ff_f (pow, minus_infty, 28, plus_infty);
+ TEST_ff_f (pow, minus_infty, 0x1p24, plus_infty);
+ TEST_ff_f (pow, minus_infty, 0x1p127, plus_infty);
+ TEST_ff_f (pow, minus_infty, max_value, plus_infty);
/* pow (-inf, y) == -0 for y an odd integer < 0. */
TEST_ff_f (pow, minus_infty, -3, minus_zero);
+ TEST_ff_f (pow, minus_infty, -0xffffff, minus_zero);
+ TEST_ff_f (pow, minus_infty, -0x1fffffe, plus_zero);
+#ifndef TEST_FLOAT
+ TEST_ff_f (pow, minus_infty, -0x1.fffffffffffffp+52L, minus_zero);
+ TEST_ff_f (pow, minus_infty, -0x1.fffffffffffffp+53L, plus_zero);
+#endif
+#ifdef TEST_LDOUBLE
+# if LDBL_MANT_DIG >= 64
+ TEST_ff_f (pow, minus_infty, -0x1.fffffffffffffffep+63L, minus_zero);
+ TEST_ff_f (pow, minus_infty, -0x1.fffffffffffffffep+64L, plus_zero);
+# endif
+# if LDBL_MANT_DIG >= 106
+ TEST_ff_f (pow, minus_infty, -0x1.ffffffffffffffffffffffffff8p+105L, minus_zero);
+ TEST_ff_f (pow, minus_infty, -0x1.ffffffffffffffffffffffffff8p+106L, plus_zero);
+# endif
+# if LDBL_MANT_DIG >= 113
+ TEST_ff_f (pow, minus_infty, -0x1.ffffffffffffffffffffffffffffp+112L, minus_zero);
+ TEST_ff_f (pow, minus_infty, -0x1.ffffffffffffffffffffffffffffp+113L, plus_zero);
+# endif
+#endif
/* pow (-inf, y) == +0 for y < 0 and not an odd integer. */
TEST_ff_f (pow, minus_infty, -2.0, 0.0);
+ TEST_ff_f (pow, minus_infty, -0x1p24, 0.0);
+ TEST_ff_f (pow, minus_infty, -0x1p127, 0.0);
+ TEST_ff_f (pow, minus_infty, -max_value, 0.0);
/* pow (+0, y) == +0 for y an odd integer > 0. */
TEST_ff_f (pow, 0.0, 27, 0.0);
+ TEST_ff_f (pow, 0.0, 0xffffff, 0.0);
+#ifndef TEST_FLOAT
+ TEST_ff_f (pow, 0.0, 0x1.fffffffffffffp+52L, 0.0);
+#endif
+#ifdef TEST_LDOUBLE
+# if LDBL_MANT_DIG >= 64
+ TEST_ff_f (pow, 0.0, 0x1.fffffffffffffffep+63L, 0.0);
+# endif
+# if LDBL_MANT_DIG >= 106
+ TEST_ff_f (pow, 0.0, 0x1.ffffffffffffffffffffffffff8p+105L, 0.0);
+# endif
+# if LDBL_MANT_DIG >= 113
+ TEST_ff_f (pow, 0.0, 0x1.ffffffffffffffffffffffffffffp+112L, 0.0);
+# endif
+#endif
/* pow (-0, y) == -0 for y an odd integer > 0. */
TEST_ff_f (pow, minus_zero, 27, minus_zero);
+ TEST_ff_f (pow, minus_zero, 0xffffff, minus_zero);
+ TEST_ff_f (pow, minus_zero, 0x1fffffe, plus_zero);
+#ifndef TEST_FLOAT
+ TEST_ff_f (pow, minus_zero, 0x1.fffffffffffffp+52L, minus_zero);
+ TEST_ff_f (pow, minus_zero, 0x1.fffffffffffffp+53L, plus_zero);
+#endif
+#ifdef TEST_LDOUBLE
+# if LDBL_MANT_DIG >= 64
+ TEST_ff_f (pow, minus_zero, 0x1.fffffffffffffffep+63L, minus_zero);
+ TEST_ff_f (pow, minus_zero, 0x1.fffffffffffffffep+64L, plus_zero);
+# endif
+# if LDBL_MANT_DIG >= 106
+ TEST_ff_f (pow, minus_zero, 0x1.ffffffffffffffffffffffffff8p+105L, minus_zero);
+ TEST_ff_f (pow, minus_zero, 0x1.ffffffffffffffffffffffffff8p+106L, plus_zero);
+# endif
+# if LDBL_MANT_DIG >= 113
+ TEST_ff_f (pow, minus_zero, 0x1.ffffffffffffffffffffffffffffp+112L, minus_zero);
+ TEST_ff_f (pow, minus_zero, 0x1.ffffffffffffffffffffffffffffp+113L, plus_zero);
+# endif
+#endif
/* pow (+0, y) == +0 for y > 0 and not an odd integer. */
TEST_ff_f (pow, 0.0, 4, 0.0);
+ TEST_ff_f (pow, 0.0, 0x1p24, 0.0);
+ TEST_ff_f (pow, 0.0, 0x1p127, 0.0);
+ TEST_ff_f (pow, 0.0, max_value, 0.0);
/* pow (-0, y) == +0 for y > 0 and not an odd integer. */
TEST_ff_f (pow, minus_zero, 4, 0.0);
+ TEST_ff_f (pow, minus_zero, 0x1p24, 0.0);
+ TEST_ff_f (pow, minus_zero, 0x1p127, 0.0);
+ TEST_ff_f (pow, minus_zero, max_value, 0.0);
TEST_ff_f (pow, 16, 0.25L, 2);
TEST_ff_f (pow, 0x1p64L, 0.125L, 256);
@@ -6256,13 +6583,13 @@ scalbn_test (void)
TEST_fi_f (scalbn, 1, 0L, 1);
- TEST_fi_f (scalbn, 1, INT_MAX, plus_infty);
+ TEST_fi_f (scalbn, 1, INT_MAX, plus_infty, OVERFLOW_EXCEPTION);
TEST_fi_f (scalbn, 1, INT_MIN, plus_zero);
- TEST_fi_f (scalbn, max_value, INT_MAX, plus_infty);
+ TEST_fi_f (scalbn, max_value, INT_MAX, plus_infty, OVERFLOW_EXCEPTION);
TEST_fi_f (scalbn, max_value, INT_MIN, plus_zero);
- TEST_fi_f (scalbn, min_value, INT_MAX, plus_infty);
+ TEST_fi_f (scalbn, min_value, INT_MAX, plus_infty, OVERFLOW_EXCEPTION);
TEST_fi_f (scalbn, min_value, INT_MIN, plus_zero);
- TEST_fi_f (scalbn, min_value / 4, INT_MAX, plus_infty);
+ TEST_fi_f (scalbn, min_value / 4, INT_MAX, plus_infty, OVERFLOW_EXCEPTION);
TEST_fi_f (scalbn, min_value / 4, INT_MIN, plus_zero);
END (scalbn);
@@ -6287,32 +6614,32 @@ scalbln_test (void)
TEST_fl_f (scalbln, 1, 0L, 1);
- TEST_fi_f (scalbln, 1, INT_MAX, plus_infty);
+ TEST_fi_f (scalbln, 1, INT_MAX, plus_infty, OVERFLOW_EXCEPTION);
TEST_fi_f (scalbln, 1, INT_MIN, plus_zero);
- TEST_fi_f (scalbln, max_value, INT_MAX, plus_infty);
+ TEST_fi_f (scalbln, max_value, INT_MAX, plus_infty, OVERFLOW_EXCEPTION);
TEST_fi_f (scalbln, max_value, INT_MIN, plus_zero);
- TEST_fi_f (scalbln, min_value, INT_MAX, plus_infty);
+ TEST_fi_f (scalbln, min_value, INT_MAX, plus_infty, OVERFLOW_EXCEPTION);
TEST_fi_f (scalbln, min_value, INT_MIN, plus_zero);
- TEST_fi_f (scalbln, min_value / 4, INT_MAX, plus_infty);
+ TEST_fi_f (scalbln, min_value / 4, INT_MAX, plus_infty, OVERFLOW_EXCEPTION);
TEST_fi_f (scalbln, min_value / 4, INT_MIN, plus_zero);
- TEST_fi_f (scalbln, 1, LONG_MAX, plus_infty);
+ TEST_fi_f (scalbln, 1, LONG_MAX, plus_infty, OVERFLOW_EXCEPTION);
TEST_fi_f (scalbln, 1, LONG_MIN, plus_zero);
- TEST_fi_f (scalbln, max_value, LONG_MAX, plus_infty);
+ TEST_fi_f (scalbln, max_value, LONG_MAX, plus_infty, OVERFLOW_EXCEPTION);
TEST_fi_f (scalbln, max_value, LONG_MIN, plus_zero);
- TEST_fi_f (scalbln, min_value, LONG_MAX, plus_infty);
+ TEST_fi_f (scalbln, min_value, LONG_MAX, plus_infty, OVERFLOW_EXCEPTION);
TEST_fi_f (scalbln, min_value, LONG_MIN, plus_zero);
- TEST_fi_f (scalbln, min_value / 4, LONG_MAX, plus_infty);
+ TEST_fi_f (scalbln, min_value / 4, LONG_MAX, plus_infty, OVERFLOW_EXCEPTION);
TEST_fi_f (scalbln, min_value / 4, LONG_MIN, plus_zero);
#if LONG_MAX >= 0x100000000
- TEST_fi_f (scalbln, 1, 0x88000000L, plus_infty);
+ TEST_fi_f (scalbln, 1, 0x88000000L, plus_infty, OVERFLOW_EXCEPTION);
TEST_fi_f (scalbln, 1, -0x88000000L, plus_zero);
- TEST_fi_f (scalbln, max_value, 0x88000000L, plus_infty);
+ TEST_fi_f (scalbln, max_value, 0x88000000L, plus_infty, OVERFLOW_EXCEPTION);
TEST_fi_f (scalbln, max_value, -0x88000000L, plus_zero);
- TEST_fi_f (scalbln, min_value, 0x88000000L, plus_infty);
+ TEST_fi_f (scalbln, min_value, 0x88000000L, plus_infty, OVERFLOW_EXCEPTION);
TEST_fi_f (scalbln, min_value, -0x88000000L, plus_zero);
- TEST_fi_f (scalbln, min_value / 4, 0x88000000L, plus_infty);
+ TEST_fi_f (scalbln, min_value / 4, 0x88000000L, plus_infty, OVERFLOW_EXCEPTION);
TEST_fi_f (scalbln, min_value / 4, -0x88000000L, plus_zero);
#endif
@@ -6369,11 +6696,23 @@ sin_test (void)
TEST_f_f (sin, -M_PI_2l, -1);
TEST_f_f (sin, 0.75L, 0.681638760023334166733241952779893935L);
+ TEST_f_f (sin, 0x1p65, -0.047183876212354673805106149805700013943218L);
+ TEST_f_f (sin, -0x1p65, 0.047183876212354673805106149805700013943218L);
+
#ifdef TEST_DOUBLE
TEST_f_f (sin, 0.80190127184058835, 0.71867942238767868);
TEST_f_f (sin, 2.522464e-1, 2.4957989804940911e-1);
#endif
+#ifndef TEST_FLOAT
+ TEST_f_f (sin, 1e22, -0.8522008497671888017727058937530293682618L);
+ TEST_f_f (sin, 0x1p1023, 0.5631277798508840134529434079444683477104L);
+#endif
+
+#if defined TEST_LDOUBLE && LDBL_MAX_EXP >= 16384
+ TEST_f_f (sin, 0x1p16383L, 0.3893629985894208126948115852610595405563L);
+#endif
+
END (sin);
}
@@ -6541,10 +6880,22 @@ sincos_test (void)
TEST_extra (sincos, M_PI_6l*2.0, 0.86602540378443864676372317075293616L, 0.5);
TEST_extra (sincos, 0.75L, 0.681638760023334166733241952779893935L, 0.731688868873820886311838753000084544L);
+ TEST_extra (sincos, 0x1p65, -0.047183876212354673805106149805700013943218L, 0.99888622066058013610642172179340364209972L);
+ TEST_extra (sincos, -0x1p65, 0.047183876212354673805106149805700013943218L, 0.99888622066058013610642172179340364209972L);
+
#ifdef TEST_DOUBLE
TEST_extra (sincos, 0.80190127184058835, 0.71867942238767868, 0.69534156199418473);
#endif
+#ifndef TEST_FLOAT
+ TEST_extra (sincos, 1e22, -0.8522008497671888017727058937530293682618L, 0.5232147853951389454975944733847094921409L);
+ TEST_extra (sincos, 0x1p1023, 0.5631277798508840134529434079444683477104L, -0.826369834614147994500785680811743734805L);
+#endif
+
+#if defined TEST_LDOUBLE && LDBL_MAX_EXP >= 16384
+ TEST_extra (sincos, 0x1p16383L, 0.3893629985894208126948115852610595405563L, 0.9210843909921906206874509522505756251609L);
+#endif
+
END (sincos);
}
@@ -6742,6 +7093,18 @@ tan_test (void)
TEST_f_f (tan, M_PI_4l, 1);
TEST_f_f (tan, 0.75L, 0.931596459944072461165202756573936428L);
+ TEST_f_f (tan, 0x1p65, -0.0472364872359047946798414219288370688827L);
+ TEST_f_f (tan, -0x1p65, 0.0472364872359047946798414219288370688827L);
+
+#ifndef TEST_FLOAT
+ TEST_f_f (tan, 1e22, -1.628778225606898878549375936939548513545L);
+ TEST_f_f (tan, 0x1p1023, -0.6814476476066215012854144040167365190368L);
+#endif
+
+#if defined TEST_LDOUBLE && LDBL_MAX_EXP >= 16384
+ TEST_f_f (tan, 0x1p16383L, 0.422722393732022337800504160054440141575L);
+#endif
+
END (tan);
}
@@ -7086,6 +7449,12 @@ y0_test (void)
TEST_f_f (y0, 8.0, 0.223521489387566220527323400498620359L);
TEST_f_f (y0, 10.0, 0.0556711672835993914244598774101900481L);
+ TEST_f_f (y0, 0x1.3ffp+74L, 1.818984347516051243459467456433028748678e-12L);
+
+#ifndef TEST_FLOAT
+ TEST_f_f (y0, 0x1.ff00000000002p+840L, 1.846591691699331493194965158699937660696e-127L);
+#endif
+
END (y0);
}
@@ -7120,6 +7489,12 @@ y1_test (void)
TEST_f_f (y1, 8.0, -0.158060461731247494255555266187483550L);
TEST_f_f (y1, 10.0, 0.249015424206953883923283474663222803L);
+ TEST_f_f (y1, 0x1.27e204p+99L, -8.881610148467797208469612080785210013461e-16L);
+
+#ifndef TEST_FLOAT
+ TEST_f_f (y1, 0x1.001000001p+593L, 3.927269966354206207832593635798954916263e-90L);
+#endif
+
END (y1);
}
diff --git a/libc/math/s_clog.c b/libc/math/s_clog.c
index 5bbca0038..15e5e9c67 100644
--- a/libc/math/s_clog.c
+++ b/libc/math/s_clog.c
@@ -1,5 +1,5 @@
/* Compute complex natural logarithm.
- Copyright (C) 1997, 2011 Free Software Foundation, Inc.
+ Copyright (C) 1997-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -20,7 +20,7 @@
#include <complex.h>
#include <math.h>
#include <math_private.h>
-
+#include <float.h>
__complex__ double
__clog (__complex__ double x)
@@ -40,8 +40,27 @@ __clog (__complex__ double x)
else if (__builtin_expect (rcls != FP_NAN && icls != FP_NAN, 1))
{
/* Neither real nor imaginary part is NaN. */
- __real__ result = __ieee754_log (__ieee754_hypot (__real__ x,
- __imag__ x));
+ double d;
+ int scale = 0;
+
+ if (fabs (__real__ x) > DBL_MAX / 2.0
+ || fabs (__imag__ x) > DBL_MAX / 2.0)
+ {
+ scale = -1;
+ __real__ x = __scalbn (__real__ x, scale);
+ __imag__ x = __scalbn (__imag__ x, scale);
+ }
+ else if (fabs (__real__ x) < DBL_MIN
+ && fabs (__imag__ x) < DBL_MIN)
+ {
+ scale = DBL_MANT_DIG;
+ __real__ x = __scalbn (__real__ x, scale);
+ __imag__ x = __scalbn (__imag__ x, scale);
+ }
+
+ d = __ieee754_hypot (__real__ x, __imag__ x);
+
+ __real__ result = __ieee754_log (d) - scale * M_LN2;
__imag__ result = __ieee754_atan2 (__imag__ x, __real__ x);
}
else
diff --git a/libc/math/s_clog10.c b/libc/math/s_clog10.c
index 3eb9c518a..9d366d6f2 100644
--- a/libc/math/s_clog10.c
+++ b/libc/math/s_clog10.c
@@ -1,5 +1,5 @@
/* Compute complex base 10 logarithm.
- Copyright (C) 1997, 2011 Free Software Foundation, Inc.
+ Copyright (C) 1997-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -20,7 +20,10 @@
#include <complex.h>
#include <math.h>
#include <math_private.h>
+#include <float.h>
+/* log_10 (2). */
+#define M_LOG10_2 0.3010299956639811952137388947244930267682
__complex__ double
__clog10 (__complex__ double x)
@@ -40,8 +43,27 @@ __clog10 (__complex__ double x)
else if (__builtin_expect (rcls != FP_NAN && icls != FP_NAN, 1))
{
/* Neither real nor imaginary part is NaN. */
- __real__ result = __ieee754_log10 (__ieee754_hypot (__real__ x,
- __imag__ x));
+ double d;
+ int scale = 0;
+
+ if (fabs (__real__ x) > DBL_MAX / 2.0
+ || fabs (__imag__ x) > DBL_MAX / 2.0)
+ {
+ scale = -1;
+ __real__ x = __scalbn (__real__ x, scale);
+ __imag__ x = __scalbn (__imag__ x, scale);
+ }
+ else if (fabs (__real__ x) < DBL_MIN
+ && fabs (__imag__ x) < DBL_MIN)
+ {
+ scale = DBL_MANT_DIG;
+ __real__ x = __scalbn (__real__ x, scale);
+ __imag__ x = __scalbn (__imag__ x, scale);
+ }
+
+ d = __ieee754_hypot (__real__ x, __imag__ x);
+
+ __real__ result = __ieee754_log10 (d) - scale * M_LOG10_2;
__imag__ result = M_LOG10E * __ieee754_atan2 (__imag__ x, __real__ x);
}
else
diff --git a/libc/math/s_clog10f.c b/libc/math/s_clog10f.c
index e48d928b3..11bb0bb9a 100644
--- a/libc/math/s_clog10f.c
+++ b/libc/math/s_clog10f.c
@@ -1,5 +1,5 @@
/* Compute complex base 10 logarithm.
- Copyright (C) 1997, 2011 Free Software Foundation, Inc.
+ Copyright (C) 1997-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -20,7 +20,10 @@
#include <complex.h>
#include <math.h>
#include <math_private.h>
+#include <float.h>
+/* log_10 (2). */
+#define M_LOG10_2f 0.3010299956639811952137388947244930267682f
__complex__ float
__clog10f (__complex__ float x)
@@ -40,8 +43,27 @@ __clog10f (__complex__ float x)
else if (__builtin_expect (rcls != FP_NAN && icls != FP_NAN, 1))
{
/* Neither real nor imaginary part is NaN. */
- __real__ result = __ieee754_log10f (__ieee754_hypotf (__real__ x,
- __imag__ x));
+ float d;
+ int scale = 0;
+
+ if (fabsf (__real__ x) > FLT_MAX / 2.0f
+ || fabsf (__imag__ x) > FLT_MAX / 2.0f)
+ {
+ scale = -1;
+ __real__ x = __scalbnf (__real__ x, scale);
+ __imag__ x = __scalbnf (__imag__ x, scale);
+ }
+ else if (fabsf (__real__ x) < FLT_MIN
+ && fabsf (__imag__ x) < FLT_MIN)
+ {
+ scale = FLT_MANT_DIG;
+ __real__ x = __scalbnf (__real__ x, scale);
+ __imag__ x = __scalbnf (__imag__ x, scale);
+ }
+
+ d = __ieee754_hypotf (__real__ x, __imag__ x);
+
+ __real__ result = __ieee754_log10f (d) - scale * M_LOG10_2f;
__imag__ result = M_LOG10E * __ieee754_atan2f (__imag__ x, __real__ x);
}
else
diff --git a/libc/math/s_clog10l.c b/libc/math/s_clog10l.c
index 72b553152..d1fc872cb 100644
--- a/libc/math/s_clog10l.c
+++ b/libc/math/s_clog10l.c
@@ -1,5 +1,5 @@
/* Compute complex base 10 logarithm.
- Copyright (C) 1997, 1998, 2011 Free Software Foundation, Inc.
+ Copyright (C) 1997-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -20,7 +20,10 @@
#include <complex.h>
#include <math.h>
#include <math_private.h>
+#include <float.h>
+/* log_10 (2). */
+#define M_LOG10_2l 0.3010299956639811952137388947244930267682L
__complex__ long double
__clog10l (__complex__ long double x)
@@ -40,8 +43,27 @@ __clog10l (__complex__ long double x)
else if (__builtin_expect (rcls != FP_NAN && icls != FP_NAN, 1))
{
/* Neither real nor imaginary part is NaN. */
- __real__ result = __ieee754_log10l (__ieee754_hypotl (__real__ x,
- __imag__ x));
+ long double d;
+ int scale = 0;
+
+ if (fabsl (__real__ x) > LDBL_MAX / 2.0L
+ || fabsl (__imag__ x) > LDBL_MAX / 2.0L)
+ {
+ scale = -1;
+ __real__ x = __scalbnl (__real__ x, scale);
+ __imag__ x = __scalbnl (__imag__ x, scale);
+ }
+ else if (fabsl (__real__ x) < LDBL_MIN
+ && fabsl (__imag__ x) < LDBL_MIN)
+ {
+ scale = LDBL_MANT_DIG;
+ __real__ x = __scalbnl (__real__ x, scale);
+ __imag__ x = __scalbnl (__imag__ x, scale);
+ }
+
+ d = __ieee754_hypotl (__real__ x, __imag__ x);
+
+ __real__ result = __ieee754_log10l (d) - scale * M_LOG10_2l;
__imag__ result = M_LOG10El * __ieee754_atan2l (__imag__ x, __real__ x);
}
else
diff --git a/libc/math/s_clogf.c b/libc/math/s_clogf.c
index eb8433a28..0b27506fb 100644
--- a/libc/math/s_clogf.c
+++ b/libc/math/s_clogf.c
@@ -1,5 +1,5 @@
/* Compute complex natural logarithm.
- Copyright (C) 1997, 2011 Free Software Foundation, Inc.
+ Copyright (C) 1997-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -19,9 +19,8 @@
#include <complex.h>
#include <math.h>
-
#include <math_private.h>
-
+#include <float.h>
__complex__ float
__clogf (__complex__ float x)
@@ -41,8 +40,27 @@ __clogf (__complex__ float x)
else if (__builtin_expect (rcls != FP_NAN && icls != FP_NAN, 1))
{
/* Neither real nor imaginary part is NaN. */
- __real__ result = __ieee754_logf (__ieee754_hypotf (__real__ x,
- __imag__ x));
+ float d;
+ int scale = 0;
+
+ if (fabsf (__real__ x) > FLT_MAX / 2.0f
+ || fabsf (__imag__ x) > FLT_MAX / 2.0f)
+ {
+ scale = -1;
+ __real__ x = __scalbnf (__real__ x, scale);
+ __imag__ x = __scalbnf (__imag__ x, scale);
+ }
+ else if (fabsf (__real__ x) < FLT_MIN
+ && fabsf (__imag__ x) < FLT_MIN)
+ {
+ scale = FLT_MANT_DIG;
+ __real__ x = __scalbnf (__real__ x, scale);
+ __imag__ x = __scalbnf (__imag__ x, scale);
+ }
+
+ d = __ieee754_hypotf (__real__ x, __imag__ x);
+
+ __real__ result = __ieee754_logf (d) - scale * (float) M_LN2;
__imag__ result = __ieee754_atan2f (__imag__ x, __real__ x);
}
else
diff --git a/libc/math/s_clogl.c b/libc/math/s_clogl.c
index 11d487825..8968eefee 100644
--- a/libc/math/s_clogl.c
+++ b/libc/math/s_clogl.c
@@ -1,5 +1,5 @@
/* Compute complex natural logarithm.
- Copyright (C) 1997, 1998, 2011 Free Software Foundation, Inc.
+ Copyright (C) 1997-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -20,7 +20,7 @@
#include <complex.h>
#include <math.h>
#include <math_private.h>
-
+#include <float.h>
__complex__ long double
__clogl (__complex__ long double x)
@@ -40,8 +40,27 @@ __clogl (__complex__ long double x)
else if (__builtin_expect (rcls != FP_NAN && icls != FP_NAN, 1))
{
/* Neither real nor imaginary part is NaN. */
- __real__ result = __ieee754_logl (__ieee754_hypotl (__real__ x,
- __imag__ x));
+ long double d;
+ int scale = 0;
+
+ if (fabsl (__real__ x) > LDBL_MAX / 2.0L
+ || fabsl (__imag__ x) > LDBL_MAX / 2.0L)
+ {
+ scale = -1;
+ __real__ x = __scalbnl (__real__ x, scale);
+ __imag__ x = __scalbnl (__imag__ x, scale);
+ }
+ else if (fabsl (__real__ x) < LDBL_MIN
+ && fabsl (__imag__ x) < LDBL_MIN)
+ {
+ scale = LDBL_MANT_DIG;
+ __real__ x = __scalbnl (__real__ x, scale);
+ __imag__ x = __scalbnl (__imag__ x, scale);
+ }
+
+ d = __ieee754_hypotl (__real__ x, __imag__ x);
+
+ __real__ result = __ieee754_logl (d) - scale * M_LN2l;
__imag__ result = __ieee754_atan2l (__imag__ x, __real__ x);
}
else
diff --git a/libc/math/s_csqrt.c b/libc/math/s_csqrt.c
index 76585e889..002ea5fdc 100644
--- a/libc/math/s_csqrt.c
+++ b/libc/math/s_csqrt.c
@@ -1,5 +1,5 @@
/* Complex square root of double value.
- Copyright (C) 1997, 1998, 2005, 2011 Free Software Foundation, Inc.
+ Copyright (C) 1997-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Based on an algorithm by Stephen L. Moshier <moshier@world.std.com>.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -21,7 +21,7 @@
#include <complex.h>
#include <math.h>
#include <math_private.h>
-
+#include <float.h>
__complex__ double
__csqrt (__complex__ double x)
@@ -83,6 +83,22 @@ __csqrt (__complex__ double x)
else
{
double d, r, s;
+ int scale = 0;
+
+ if (fabs (__real__ x) > DBL_MAX / 2.0
+ || fabs (__imag__ x) > DBL_MAX / 2.0)
+ {
+ scale = 1;
+ __real__ x = __scalbn (__real__ x, -2 * scale);
+ __imag__ x = __scalbn (__imag__ x, -2 * scale);
+ }
+ else if (fabs (__real__ x) < DBL_MIN
+ && fabs (__imag__ x) < DBL_MIN)
+ {
+ scale = -(DBL_MANT_DIG / 2);
+ __real__ x = __scalbn (__real__ x, -2 * scale);
+ __imag__ x = __scalbn (__imag__ x, -2 * scale);
+ }
d = __ieee754_hypot (__real__ x, __imag__ x);
/* Use the identity 2 Re res Im res = Im x
@@ -98,6 +114,12 @@ __csqrt (__complex__ double x)
r = fabs ((0.5 * __imag__ x) / s);
}
+ if (scale)
+ {
+ r = __scalbn (r, scale);
+ s = __scalbn (s, scale);
+ }
+
__real__ res = r;
__imag__ res = __copysign (s, __imag__ x);
}
diff --git a/libc/math/s_csqrtf.c b/libc/math/s_csqrtf.c
index d9949c685..6539ba224 100644
--- a/libc/math/s_csqrtf.c
+++ b/libc/math/s_csqrtf.c
@@ -1,5 +1,5 @@
/* Complex square root of float value.
- Copyright (C) 1997, 1998, 2005, 2011 Free Software Foundation, Inc.
+ Copyright (C) 1997-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Based on an algorithm by Stephen L. Moshier <moshier@world.std.com>.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -21,7 +21,7 @@
#include <complex.h>
#include <math.h>
#include <math_private.h>
-
+#include <float.h>
__complex__ float
__csqrtf (__complex__ float x)
@@ -83,6 +83,22 @@ __csqrtf (__complex__ float x)
else
{
float d, r, s;
+ int scale = 0;
+
+ if (fabsf (__real__ x) > FLT_MAX / 2.0f
+ || fabsf (__imag__ x) > FLT_MAX / 2.0f)
+ {
+ scale = 1;
+ __real__ x = __scalbnf (__real__ x, -2 * scale);
+ __imag__ x = __scalbnf (__imag__ x, -2 * scale);
+ }
+ else if (fabsf (__real__ x) < FLT_MIN
+ && fabsf (__imag__ x) < FLT_MIN)
+ {
+ scale = -(FLT_MANT_DIG / 2);
+ __real__ x = __scalbnf (__real__ x, -2 * scale);
+ __imag__ x = __scalbnf (__imag__ x, -2 * scale);
+ }
d = __ieee754_hypotf (__real__ x, __imag__ x);
/* Use the identity 2 Re res Im res = Im x
@@ -98,6 +114,12 @@ __csqrtf (__complex__ float x)
r = fabsf ((0.5f * __imag__ x) / s);
}
+ if (scale)
+ {
+ r = __scalbnf (r, scale);
+ s = __scalbnf (s, scale);
+ }
+
__real__ res = r;
__imag__ res = __copysignf (s, __imag__ x);
}
diff --git a/libc/math/s_csqrtl.c b/libc/math/s_csqrtl.c
index 0c624c7a7..64332f67b 100644
--- a/libc/math/s_csqrtl.c
+++ b/libc/math/s_csqrtl.c
@@ -1,5 +1,5 @@
/* Complex square root of long double value.
- Copyright (C) 1997, 1998, 2005, 2011 Free Software Foundation, Inc.
+ Copyright (C) 1997-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Based on an algorithm by Stephen L. Moshier <moshier@world.std.com>.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -21,7 +21,7 @@
#include <complex.h>
#include <math.h>
#include <math_private.h>
-
+#include <float.h>
__complex__ long double
__csqrtl (__complex__ long double x)
@@ -83,6 +83,22 @@ __csqrtl (__complex__ long double x)
else
{
long double d, r, s;
+ int scale = 0;
+
+ if (fabsl (__real__ x) > LDBL_MAX / 2.0L
+ || fabsl (__imag__ x) > LDBL_MAX / 2.0L)
+ {
+ scale = 1;
+ __real__ x = __scalbnl (__real__ x, -2 * scale);
+ __imag__ x = __scalbnl (__imag__ x, -2 * scale);
+ }
+ else if (fabsl (__real__ x) < LDBL_MIN
+ && fabsl (__imag__ x) < LDBL_MIN)
+ {
+ scale = -(LDBL_MANT_DIG / 2);
+ __real__ x = __scalbnl (__real__ x, -2 * scale);
+ __imag__ x = __scalbnl (__imag__ x, -2 * scale);
+ }
d = __ieee754_hypotl (__real__ x, __imag__ x);
/* Use the identity 2 Re res Im res = Im x
@@ -98,6 +114,12 @@ __csqrtl (__complex__ long double x)
r = fabsl ((0.5L * __imag__ x) / s);
}
+ if (scale)
+ {
+ r = __scalbnl (r, scale);
+ s = __scalbnl (s, scale);
+ }
+
__real__ res = r;
__imag__ res = __copysignl (s, __imag__ x);
}
diff --git a/libc/math/w_exp2.c b/libc/math/w_exp2.c
index 7a3b0afb7..b5d8e2570 100644
--- a/libc/math/w_exp2.c
+++ b/libc/math/w_exp2.c
@@ -2,23 +2,19 @@
* wrapper exp2(x)
*/
-#include <float.h>
#include <math.h>
#include <math_private.h>
-static const double o_threshold = (double) DBL_MAX_EXP;
-static const double u_threshold = (double) (DBL_MIN_EXP - DBL_MANT_DIG - 1);
-
double
__exp2 (double x)
{
- if (__builtin_expect (islessequal (x, u_threshold)
- || isgreater (x, o_threshold), 0)
- && _LIB_VERSION != _IEEE_ && __finite (x))
+ double z = __ieee754_exp2 (x);
+ if (__builtin_expect (!__finite (z), 0)
+ && __finite (x) && _LIB_VERSION != _IEEE_)
/* exp2 overflow: 44, exp2 underflow: 45 */
- return __kernel_standard (x, x, 44 + (x <= o_threshold));
+ return __kernel_standard (x, x, 44 + !!__signbit (x));
- return __ieee754_exp2 (x);
+ return z;
}
weak_alias (__exp2, exp2)
#ifdef NO_LONG_DOUBLE
diff --git a/libc/math/w_exp2f.c b/libc/math/w_exp2f.c
index c4e9e9416..7c277ef39 100644
--- a/libc/math/w_exp2f.c
+++ b/libc/math/w_exp2f.c
@@ -2,22 +2,18 @@
* wrapper exp2f(x)
*/
-#include <float.h>
#include <math.h>
#include <math_private.h>
-static const float o_threshold = (float) FLT_MAX_EXP;
-static const float u_threshold = (float) (FLT_MIN_EXP - FLT_MANT_DIG - 1);
-
float
__exp2f (float x)
{
- if (__builtin_expect (islessequal (x, u_threshold)
- || isgreater (x, o_threshold), 0)
- && _LIB_VERSION != _IEEE_ && __finitef (x))
+ float z = __ieee754_exp2f (x);
+ if (__builtin_expect (!__finitef (z), 0)
+ && __finitef (x) && _LIB_VERSION != _IEEE_)
/* exp2 overflow: 144, exp2 underflow: 145 */
- return __kernel_standard_f (x, x, 144 + (x <= o_threshold));
+ return __kernel_standard_f (x, x, 144 + !!__signbitf (x));
- return __ieee754_exp2f (x);
+ return z;
}
weak_alias (__exp2f, exp2f)
diff --git a/libc/math/w_exp2l.c b/libc/math/w_exp2l.c
index 442a63734..f05a8fe6d 100644
--- a/libc/math/w_exp2l.c
+++ b/libc/math/w_exp2l.c
@@ -2,23 +2,18 @@
* wrapper exp2l(x)
*/
-#include <float.h>
#include <math.h>
#include <math_private.h>
-static const long double o_threshold = (long double) LDBL_MAX_EXP;
-static const long double u_threshold
- = (long double) (LDBL_MIN_EXP - LDBL_MANT_DIG - 1);
-
long double
__exp2l (long double x)
{
- if (__builtin_expect (islessequal (x, u_threshold)
- || isgreater (x, o_threshold), 0)
- && _LIB_VERSION != _IEEE_ && __finitel (x))
+ long double z = __ieee754_exp2l (x);
+ if (__builtin_expect (!__finitel (z), 0)
+ && __finitel (x) && _LIB_VERSION != _IEEE_)
/* exp2 overflow: 244, exp2 underflow: 245 */
- return __kernel_standard (x, x, 244 + (x <= o_threshold));
+ return __kernel_standard (x, x, 244 + !!__signbitl (x));
- return __ieee754_exp2l (x);
+ return z;
}
weak_alias (__exp2l, exp2l)
diff --git a/libc/math/w_j0.c b/libc/math/w_j0.c
index f8d372475..0171a0bc7 100644
--- a/libc/math/w_j0.c
+++ b/libc/math/w_j0.c
@@ -26,7 +26,7 @@ double
j0 (double x)
{
if (__builtin_expect (isgreater (fabs (x), X_TLOSS), 0)
- && _LIB_VERSION != _IEEE_)
+ && _LIB_VERSION != _IEEE_ && _LIB_VERSION != _POSIX_)
/* j0(|x|>X_TLOSS) */
return __kernel_standard (x, x, 34);
@@ -53,7 +53,7 @@ y0 (double x)
else if (x == 0.0)
/* d = -one/(x-x) */
return __kernel_standard (x, x, 8);
- else
+ else if (_LIB_VERSION != _POSIX_)
/* y0(x>X_TLOSS) */
return __kernel_standard (x, x, 35);
}
diff --git a/libc/math/w_j0f.c b/libc/math/w_j0f.c
index cef36aab1..9e1681a24 100644
--- a/libc/math/w_j0f.c
+++ b/libc/math/w_j0f.c
@@ -26,7 +26,7 @@ float
j0f (float x)
{
if (__builtin_expect (isgreater (fabsf (x), (float) X_TLOSS), 0)
- && _LIB_VERSION != _IEEE_)
+ && _LIB_VERSION != _IEEE_ && _LIB_VERSION != _POSIX_)
/* j0(|x|>X_TLOSS) */
return __kernel_standard_f (x, x, 134);
@@ -51,7 +51,7 @@ y0f (float x)
else if (x == 0.0f)
/* d = -one/(x-x) */
return __kernel_standard_f (x, x, 108);
- else
+ else if (_LIB_VERSION != _POSIX_)
/* y0(x>X_TLOSS) */
return __kernel_standard_f (x, x, 135);
}
diff --git a/libc/math/w_j0l.c b/libc/math/w_j0l.c
index 144f33c0d..54c9c8902 100644
--- a/libc/math/w_j0l.c
+++ b/libc/math/w_j0l.c
@@ -26,7 +26,7 @@ long double
__j0l (long double x)
{
if (__builtin_expect (isgreater (fabsl (x), X_TLOSS), 0)
- && _LIB_VERSION != _IEEE_)
+ && _LIB_VERSION != _IEEE_ && _LIB_VERSION != _POSIX_)
/* j0(|x|>X_TLOSS) */
return __kernel_standard (x, x, 234);
@@ -51,7 +51,7 @@ __y0l (long double x)
else if (x == 0.0L)
/* d = -one/(x-x) */
return __kernel_standard (x, x, 208);
- else
+ else if (_LIB_VERSION != _POSIX_)
/* y0(x>X_TLOSS) */
return __kernel_standard (x, x, 235);
}
diff --git a/libc/math/w_j1.c b/libc/math/w_j1.c
index e9a5357b7..40600503e 100644
--- a/libc/math/w_j1.c
+++ b/libc/math/w_j1.c
@@ -26,7 +26,7 @@ double
j1 (double x)
{
if (__builtin_expect (isgreater (fabs (x), X_TLOSS), 0)
- && _LIB_VERSION != _IEEE_)
+ && _LIB_VERSION != _IEEE_ && _LIB_VERSION != _POSIX_)
/* j1(|x|>X_TLOSS) */
return __kernel_standard (x, x, 36);
@@ -53,7 +53,7 @@ y1 (double x)
else if (x == 0.0)
/* d = -one/(x-x) */
return __kernel_standard (x, x, 10);
- else
+ else if (_LIB_VERSION != _POSIX_)
/* y1(x>X_TLOSS) */
return __kernel_standard (x, x, 37);
}
diff --git a/libc/math/w_j1f.c b/libc/math/w_j1f.c
index 29bd949ee..a3f5ee2e2 100644
--- a/libc/math/w_j1f.c
+++ b/libc/math/w_j1f.c
@@ -26,7 +26,7 @@ float
j1f (float x)
{
if (__builtin_expect (isgreater (fabsf (x), X_TLOSS), 0)
- && _LIB_VERSION != _IEEE_)
+ && _LIB_VERSION != _IEEE_ && _LIB_VERSION != _POSIX_)
/* j1(|x|>X_TLOSS) */
return __kernel_standard_f (x, x, 136);
@@ -51,7 +51,7 @@ y1f (float x)
else if (x == 0.0f)
/* d = -one/(x-x) */
return __kernel_standard_f (x, x, 110);
- else
+ else if (_LIB_VERSION != _POSIX_)
/* y1(x>X_TLOSS) */
return __kernel_standard_f (x, x, 137);
}
diff --git a/libc/math/w_j1l.c b/libc/math/w_j1l.c
index 01b855125..208377eca 100644
--- a/libc/math/w_j1l.c
+++ b/libc/math/w_j1l.c
@@ -26,7 +26,7 @@ long double
__j1l (long double x)
{
if (__builtin_expect (isgreater (fabsl (x), X_TLOSS), 0)
- && _LIB_VERSION != _IEEE_)
+ && _LIB_VERSION != _IEEE_ && _LIB_VERSION != _POSIX_)
/* j1(|x|>X_TLOSS) */
return __kernel_standard (x, x, 236);
@@ -51,7 +51,7 @@ __y1l (long double x)
else if (x == 0.0L)
/* d = -one/(x-x) */
return __kernel_standard (x, x, 210);
- else
+ else if (_LIB_VERSION != _POSIX_)
/* y1(x>X_TLOSS) */
return __kernel_standard (x, x, 237);
}
diff --git a/libc/math/w_jn.c b/libc/math/w_jn.c
index fd3fb162f..63658a93c 100644
--- a/libc/math/w_jn.c
+++ b/libc/math/w_jn.c
@@ -26,7 +26,7 @@ double
jn (int n, double x)
{
if (__builtin_expect (isgreater (fabs (x), X_TLOSS), 0)
- && _LIB_VERSION != _IEEE_)
+ && _LIB_VERSION != _IEEE_ && _LIB_VERSION != _POSIX_)
/* jn(n,|x|>X_TLOSS) */
return __kernel_standard (n, x, 38);
@@ -53,7 +53,7 @@ yn (int n, double x)
else if (x == 0.0)
/* d = -one/(x-x) */
return __kernel_standard (n, x, 12);
- else
+ else if (_LIB_VERSION != _POSIX_)
/* yn(n,x>X_TLOSS) */
return __kernel_standard (n, x, 39);
}
diff --git a/libc/math/w_jnf.c b/libc/math/w_jnf.c
index 36d6f6d57..41d9bc571 100644
--- a/libc/math/w_jnf.c
+++ b/libc/math/w_jnf.c
@@ -26,7 +26,7 @@ float
jnf (int n, float x)
{
if (__builtin_expect (isgreater (fabsf (x), (float) X_TLOSS), 0)
- && _LIB_VERSION != _IEEE_)
+ && _LIB_VERSION != _IEEE_ && _LIB_VERSION != _POSIX_)
/* jn(n,|x|>X_TLOSS) */
return __kernel_standard_f (n, x, 138);
@@ -51,7 +51,7 @@ ynf (int n, float x)
else if (x == 0.0)
/* d = -one/(x-x) */
return __kernel_standard_f (n, x, 112);
- else
+ else if (_LIB_VERSION != _POSIX_)
/* yn(n,x>X_TLOSS) */
return __kernel_standard_f (n, x, 139);
}
diff --git a/libc/math/w_jnl.c b/libc/math/w_jnl.c
index 148817ff4..2028d488d 100644
--- a/libc/math/w_jnl.c
+++ b/libc/math/w_jnl.c
@@ -54,7 +54,10 @@ long double __jnl(int n, long double x) /* wrapper jnl */
#else
long double z;
z = __ieee754_jnl(n,x);
- if(_LIB_VERSION == _IEEE_ || __isnanl(x) ) return z;
+ if (_LIB_VERSION == _IEEE_
+ || _LIB_VERSION == _POSIX_
+ || __isnanl(x))
+ return z;
if(fabsl(x)>X_TLOSS) {
return __kernel_standard((double)n,x,238); /* jn(|x|>X_TLOSS,n) */
} else
@@ -79,7 +82,7 @@ long double __ynl(int n, long double x) /* wrapper ynl */
/* d = zero/(x-x); */
return __kernel_standard((double)n,x,213);
}
- if(x>X_TLOSS) {
+ if(x>X_TLOSS && _LIB_VERSION != _POSIX_) {
return __kernel_standard((double)n,x,239); /* yn(x>X_TLOSS,n) */
} else
return z;
diff --git a/libc/nptl/ChangeLog b/libc/nptl/ChangeLog
index 34a249207..ad345f950 100644
--- a/libc/nptl/ChangeLog
+++ b/libc/nptl/ChangeLog
@@ -1,3 +1,31 @@
+2012-03-19 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/x86_64/pthreaddef.h (CURRENT_STACK_FRAME): Use
+ register char * __asm__("rsp") to get stack frame.
+
+2012-03-19 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (SYS_futex): Use
+ __NR_futex directly.
+
+2012-03-19 H.J. Lu <hongjiu.lu@intel.com>
+
+ * unwind.c (unwind_stop): Cast _Unwind_GetCFA return to
+ _Unwind_Ptr first.
+
+2012-03-16 David S. Miller <davem@davemloft.net>
+
+ [BZ #13844]
+ * sysdeps/unix/sysv/linux/libc-lowlevellock.c: Include using <..>
+ instead of "...".
+ * sysdeps/unix/sysv/linux/sparc/sparc32/libc-lowlevellock.c:
+ Delete, not needed.
+
+2012-03-15 David S. Miller <davem@davemloft.net>
+
+ [BZ #13844]
+ * sysdeps/unix/sysv/linux/sparc/sparc32/libc-lowlevellock.c: New file.
+
2012-03-09 Paul Eggert <eggert@cs.ucla.edu>
[BZ #13673]
diff --git a/libc/nptl/sysdeps/unix/sysv/linux/libc-lowlevellock.c b/libc/nptl/sysdeps/unix/sysv/linux/libc-lowlevellock.c
index 28672a65f..488376591 100644
--- a/libc/nptl/sysdeps/unix/sysv/linux/libc-lowlevellock.c
+++ b/libc/nptl/sysdeps/unix/sysv/linux/libc-lowlevellock.c
@@ -17,4 +17,4 @@
<http://www.gnu.org/licenses/>. */
/* No difference to lowlevellock.c, except we lose a couple of functions. */
-#include "lowlevellock.c"
+#include <lowlevellock.c>
diff --git a/libc/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h b/libc/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
index ab7ca6ae9..dada21c2a 100644
--- a/libc/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
+++ b/libc/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
@@ -43,7 +43,7 @@
# endif
#endif
-#define SYS_futex 202
+#define SYS_futex __NR_futex
#define FUTEX_WAIT 0
#define FUTEX_WAKE 1
#define FUTEX_CMP_REQUEUE 4
diff --git a/libc/nptl/sysdeps/x86_64/pthreaddef.h b/libc/nptl/sysdeps/x86_64/pthreaddef.h
index 7e45be47a..50587b869 100644
--- a/libc/nptl/sysdeps/x86_64/pthreaddef.h
+++ b/libc/nptl/sysdeps/x86_64/pthreaddef.h
@@ -41,7 +41,7 @@
/* Location of current stack frame. The frame pointer is not usable. */
#define CURRENT_STACK_FRAME \
- ({ char *frame; asm ("movq %%rsp, %0" : "=r" (frame)); frame; })
+ ({ register char *frame __asm__("rsp"); frame; })
/* XXX Until we have a better place keep the definitions here. */
diff --git a/libc/nptl/unwind.c b/libc/nptl/unwind.c
index 05710269c..7ccb21382 100644
--- a/libc/nptl/unwind.c
+++ b/libc/nptl/unwind.c
@@ -68,7 +68,7 @@ unwind_stop (int version, _Unwind_Action actions,
registered with the old method which would be unwound by this
step. */
struct _pthread_cleanup_buffer *oldp = buf->priv.data.cleanup;
- void *cfa = (void *) _Unwind_GetCFA (context);
+ void *cfa = (void *) (_Unwind_Ptr) _Unwind_GetCFA (context);
if (curp != oldp && (do_longjump || FRAME_LEFT (cfa, curp, adj)))
{
diff --git a/libc/nscd/nscd_getgr_r.c b/libc/nscd/nscd_getgr_r.c
index ac3d85fc3..54372e4ef 100644
--- a/libc/nscd/nscd_getgr_r.c
+++ b/libc/nscd/nscd_getgr_r.c
@@ -31,7 +31,7 @@
#include <sys/uio.h>
#include <sys/un.h>
#include <not-cancel.h>
-#include <stdio-common/_itoa.h>
+#include <_itoa.h>
#include "nscd-client.h"
#include "nscd_proto.h"
diff --git a/libc/nscd/nscd_getpw_r.c b/libc/nscd/nscd_getpw_r.c
index 409b672ee..e405057d1 100644
--- a/libc/nscd/nscd_getpw_r.c
+++ b/libc/nscd/nscd_getpw_r.c
@@ -30,7 +30,7 @@
#include <sys/uio.h>
#include <sys/un.h>
#include <not-cancel.h>
-#include <stdio-common/_itoa.h>
+#include <_itoa.h>
#include "nscd-client.h"
#include "nscd_proto.h"
diff --git a/libc/nscd/nscd_getserv_r.c b/libc/nscd/nscd_getserv_r.c
index ff85d8299..acf7e22f8 100644
--- a/libc/nscd/nscd_getserv_r.c
+++ b/libc/nscd/nscd_getserv_r.c
@@ -20,7 +20,7 @@
#include <errno.h>
#include <string.h>
#include <not-cancel.h>
-#include <stdio-common/_itoa.h>
+#include <_itoa.h>
#include "nscd-client.h"
#include "nscd_proto.h"
diff --git a/libc/nss/nss_db/db-init.c b/libc/nss/nss_db/db-init.c
index 906331ae0..d23e8f81d 100644
--- a/libc/nss/nss_db/db-init.c
+++ b/libc/nss/nss_db/db-init.c
@@ -1,5 +1,5 @@
/* Initialization in nss_db module.
- Copyright (C) 2011 Free Software Foundation, Inc.
+ Copyright (C) 2011, 2012 Free Software 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 <paths.h>
#include <nscd/nscd.h>
-
+#include <string.h>
static union
{
diff --git a/libc/posix/getopt_init.c b/libc/posix/getopt_init.c
index 9bcbd9c00..55003d4b7 100644
--- a/libc/posix/getopt_init.c
+++ b/libc/posix/getopt_init.c
@@ -27,7 +27,7 @@
#include <unistd.h>
#include <sys/types.h>
-#include <stdio-common/_itoa.h>
+#include <_itoa.h>
/* Variable to synchronize work. */
char *__getopt_nonoption_flags;
diff --git a/libc/posix/wordexp.c b/libc/posix/wordexp.c
index ece5109ae..5ace13720 100644
--- a/libc/posix/wordexp.c
+++ b/libc/posix/wordexp.c
@@ -42,7 +42,7 @@
#include <kernel-features.h>
#include <bits/libc-lock.h>
-#include <stdio-common/_itoa.h>
+#include <_itoa.h>
/* Undefine the following line for the production version. */
/* #define NDEBUG 1 */
diff --git a/libc/stdio-common/_itoa.c b/libc/stdio-common/_itoa.c
index e52f666ff..3dfff8ff6 100644
--- a/libc/stdio-common/_itoa.c
+++ b/libc/stdio-common/_itoa.c
@@ -25,7 +25,7 @@
#include <stdlib/gmp-impl.h>
#include <stdlib/longlong.h>
-#include "_itoa.h"
+#include <_itoa.h>
/* Canonize environment. For some architectures not all values might
diff --git a/libc/stdio-common/_itowa.c b/libc/stdio-common/_itowa.c
index 8047c877c..1ebc712b4 100644
--- a/libc/stdio-common/_itowa.c
+++ b/libc/stdio-common/_itowa.c
@@ -24,7 +24,7 @@
#include <stdlib/gmp-impl.h>
#include <stdlib/longlong.h>
-#include "_itowa.h"
+#include <_itowa.h>
/* Canonize environment. For some architectures not all values might
diff --git a/libc/stdio-common/printf_fphex.c b/libc/stdio-common/printf_fphex.c
index ea3861084..1c9469bcd 100644
--- a/libc/stdio-common/printf_fphex.c
+++ b/libc/stdio-common/printf_fphex.c
@@ -25,8 +25,8 @@
#include <stdio.h>
#include <string.h>
#include <wchar.h>
-#include "_itoa.h"
-#include "_itowa.h"
+#include <_itoa.h>
+#include <_itowa.h>
#include <locale/localeinfo.h>
#include <gnu/option-groups.h>
diff --git a/libc/stdio-common/vfprintf.c b/libc/stdio-common/vfprintf.c
index b04e95dc9..dcbae68c4 100644
--- a/libc/stdio-common/vfprintf.c
+++ b/libc/stdio-common/vfprintf.c
@@ -26,7 +26,7 @@
#include <wchar.h>
#include <bits/libc-lock.h>
#include <sys/param.h>
-#include "_itoa.h"
+#include <_itoa.h>
#include <locale/localeinfo.h>
#include <stdio.h>
#include <gnu/option-groups.h>
@@ -103,7 +103,7 @@
# define ISDIGIT(Ch) ((unsigned int) ((Ch) - L'0') < 10)
# define STR_LEN(Str) __wcslen (Str)
-# include "_itowa.h"
+# include <_itowa.h>
# define PUT(F, S, N) _IO_sputn ((F), (S), (N))
# define PAD(Padchar) \
diff --git a/libc/string/_strerror.c b/libc/string/_strerror.c
index 87540797d..6af622634 100644
--- a/libc/string/_strerror.c
+++ b/libc/string/_strerror.c
@@ -22,7 +22,7 @@
#include <stdlib.h>
#include <string.h>
#include <sys/param.h>
-#include <stdio-common/_itoa.h>
+#include <_itoa.h>
/* It is critical here that we always use the `dcgettext' function for
the message translation. Since <libintl.h> only defines the macro
diff --git a/libc/stdio-common/_itoa.h b/libc/sysdeps/generic/_itoa.h
index 8870ee028..8870ee028 100644
--- a/libc/stdio-common/_itoa.h
+++ b/libc/sysdeps/generic/_itoa.h
diff --git a/libc/sysdeps/generic/dl-osinfo.h b/libc/sysdeps/generic/dl-osinfo.h
index 548fc4666..983cd557b 100644
--- a/libc/sysdeps/generic/dl-osinfo.h
+++ b/libc/sysdeps/generic/dl-osinfo.h
@@ -37,9 +37,9 @@ _dl_setup_stack_chk_guard (void *dl_random)
{
memcpy (ret.bytes, dl_random, sizeof (ret));
#if BYTE_ORDER == LITTLE_ENDIAN
- ret.num &= ~0xff;
+ ret.num &= ~(uintptr_t) 0xff;
#elif BYTE_ORDER == BIG_ENDIAN
- ret.num &= ~(0xff << (8 * (sizeof (ret) - 1)));
+ ret.num &= ~((uintptr_t) 0xff << (8 * (sizeof (ret) - 1)));
#else
# error "BYTE_ORDER unknown"
#endif
diff --git a/libc/sysdeps/generic/elf/backtracesymsfd.c b/libc/sysdeps/generic/elf/backtracesymsfd.c
index 8b4a836ce..3562c50a7 100644
--- a/libc/sysdeps/generic/elf/backtracesymsfd.c
+++ b/libc/sysdeps/generic/elf/backtracesymsfd.c
@@ -21,7 +21,7 @@
#include <string.h>
#include <sys/uio.h>
-#include <stdio-common/_itoa.h>
+#include <_itoa.h>
#include <ldsodefs.h>
#if __ELF_NATIVE_CLASS == 32
diff --git a/libc/sysdeps/generic/ldconfig.h b/libc/sysdeps/generic/ldconfig.h
index 7e93ea8e5..ef3f4b99c 100644
--- a/libc/sysdeps/generic/ldconfig.h
+++ b/libc/sysdeps/generic/ldconfig.h
@@ -33,6 +33,7 @@
#define FLAG_POWERPC_LIB64 0x0500
#define FLAG_MIPS64_LIBN32 0x0600
#define FLAG_MIPS64_LIBN64 0x0700
+#define FLAG_X8664_LIBX32 0x0800
/* Name of auxiliary cache. */
#define _PATH_LDCONFIG_AUX_CACHE "/var/cache/ldconfig/aux-cache"
diff --git a/libc/sysdeps/generic/math_private.h b/libc/sysdeps/generic/math_private.h
index 777762dd3..813ad9361 100644
--- a/libc/sysdeps/generic/math_private.h
+++ b/libc/sysdeps/generic/math_private.h
@@ -19,6 +19,7 @@
#include <endian.h>
#include <stdint.h>
#include <sys/types.h>
+#include <fenv.h>
/* The original fdlibm code used statements like:
n0 = ((*(int*)&one)>>29)^1; * index of high word *
@@ -76,50 +77,59 @@ do { \
/* Get the more significant 32 bit int from a double. */
-#define GET_HIGH_WORD(i,d) \
+#ifndef GET_HIGH_WORD
+# define GET_HIGH_WORD(i,d) \
do { \
ieee_double_shape_type gh_u; \
gh_u.value = (d); \
(i) = gh_u.parts.msw; \
} while (0)
+#endif
/* Get the less significant 32 bit int from a double. */
-#define GET_LOW_WORD(i,d) \
+#ifndef GET_LOW_WORD
+# define GET_LOW_WORD(i,d) \
do { \
ieee_double_shape_type gl_u; \
gl_u.value = (d); \
(i) = gl_u.parts.lsw; \
} while (0)
+#endif
/* Get all in one, efficient on 64-bit machines. */
-#define EXTRACT_WORDS64(i,d) \
+#ifndef EXTRACT_WORDS64
+# define EXTRACT_WORDS64(i,d) \
do { \
ieee_double_shape_type gh_u; \
gh_u.value = (d); \
(i) = gh_u.word; \
} while (0)
+#endif
/* Set a double from two 32 bit ints. */
-
-#define INSERT_WORDS(d,ix0,ix1) \
+#ifndef INSERT_WORDS
+# define INSERT_WORDS(d,ix0,ix1) \
do { \
ieee_double_shape_type iw_u; \
iw_u.parts.msw = (ix0); \
iw_u.parts.lsw = (ix1); \
(d) = iw_u.value; \
} while (0)
+#endif
/* Get all in one, efficient on 64-bit machines. */
-#define INSERT_WORDS64(d,i) \
+#ifndef INSERT_WORDS64
+# define INSERT_WORDS64(d,i) \
do { \
ieee_double_shape_type iw_u; \
iw_u.word = (i); \
(d) = iw_u.value; \
} while (0)
+#endif
/* Set the more significant 32 bits of a double from an int. */
-
+#ifndef SET_HIGH_WORD
#define SET_HIGH_WORD(d,v) \
do { \
ieee_double_shape_type sh_u; \
@@ -127,16 +137,18 @@ do { \
sh_u.parts.msw = (v); \
(d) = sh_u.value; \
} while (0)
+#endif
/* Set the less significant 32 bits of a double from an int. */
-
-#define SET_LOW_WORD(d,v) \
+#ifndef SET_LOW_WORD
+# define SET_LOW_WORD(d,v) \
do { \
ieee_double_shape_type sl_u; \
sl_u.value = (d); \
sl_u.parts.lsw = (v); \
(d) = sl_u.value; \
} while (0)
+#endif
/* A union which permits us to convert between a float and a 32 bit
int. */
@@ -148,22 +160,24 @@ typedef union
} ieee_float_shape_type;
/* Get a 32 bit int from a float. */
-
-#define GET_FLOAT_WORD(i,d) \
+#ifndef GET_FLOAT_WORD
+# define GET_FLOAT_WORD(i,d) \
do { \
ieee_float_shape_type gf_u; \
gf_u.value = (d); \
(i) = gf_u.word; \
} while (0)
+#endif
/* Set a float from a 32 bit int. */
-
-#define SET_FLOAT_WORD(d,i) \
+#ifndef SET_FLOAT_WORD
+# define SET_FLOAT_WORD(d,i) \
do { \
ieee_float_shape_type sf_u; \
sf_u.word = (i); \
(d) = sf_u.value; \
} while (0)
+#endif
/* Get long double macros from a separate header. */
#include <math_ldbl.h>
@@ -359,28 +373,176 @@ extern void __docos (double __x, double __dx, double __v[]);
know what operations are going to be performed. Therefore we
define additional interfaces. By default they refer to the normal
interfaces. */
-#define libc_feholdexcept(e) (void) feholdexcept (e)
-#define libc_feholdexceptf(e) (void) feholdexcept (e)
-#define libc_feholdexceptl(e) (void) feholdexcept (e)
-
-#define libc_feholdexcept_setround(e, r) \
- do { feholdexcept (e); fesetround (r); } while (0)
-#define libc_feholdexcept_setroundf(e, r) \
- do { feholdexcept (e); fesetround (r); } while (0)
-#define libc_feholdexcept_setroundl(e, r) \
- do { feholdexcept (e); fesetround (r); } while (0)
-
-#define libc_fetestexcept(e) fetestexcept (e)
-#define libc_fetestexceptf(e) fetestexcept (e)
-#define libc_fetestexceptl(e) fetestexcept (e)
-
-#define libc_fesetenv(e) (void) fesetenv (e)
-#define libc_fesetenvf(e) (void) fesetenv (e)
-#define libc_fesetenvl(e) (void) fesetenv (e)
-
-#define libc_feupdateenv(e) (void) feupdateenv (e)
-#define libc_feupdateenvf(e) (void) feupdateenv (e)
-#define libc_feupdateenvl(e) (void) feupdateenv (e)
+
+static __always_inline void
+default_libc_feholdexcept (fenv_t *e)
+{
+ (void) feholdexcept (e);
+}
+
+#ifndef libc_feholdexcept
+# define libc_feholdexcept default_libc_feholdexcept
+#endif
+#ifndef libc_feholdexceptf
+# define libc_feholdexceptf default_libc_feholdexcept
+#endif
+#ifndef libc_feholdexceptl
+# define libc_feholdexceptl default_libc_feholdexcept
+#endif
+
+static __always_inline void
+default_libc_feholdexcept_setround (fenv_t *e, int r)
+{
+ feholdexcept (e);
+ fesetround (r);
+}
+
+#ifndef libc_feholdexcept_setround
+# define libc_feholdexcept_setround default_libc_feholdexcept_setround
+#endif
+#ifndef libc_feholdexcept_setroundf
+# define libc_feholdexcept_setroundf default_libc_feholdexcept_setround
+#endif
+#ifndef libc_feholdexcept_setroundl
+# define libc_feholdexcept_setroundl default_libc_feholdexcept_setround
+#endif
+
+#ifndef libc_feholdexcept_setround_53bit
+# define libc_feholdexcept_setround_53bit libc_feholdexcept_setround
+#endif
+
+#ifndef libc_fetestexcept
+# define libc_fetestexcept fetestexcept
+#endif
+#ifndef libc_fetestexceptf
+# define libc_fetestexceptf fetestexcept
+#endif
+#ifndef libc_fetestexceptl
+# define libc_fetestexceptl fetestexcept
+#endif
+
+static __always_inline void
+default_libc_fesetenv (fenv_t *e)
+{
+ (void) fesetenv (e);
+}
+
+#ifndef libc_fesetenv
+# define libc_fesetenv default_libc_fesetenv
+#endif
+#ifndef libc_fesetenvf
+# define libc_fesetenvf default_libc_fesetenv
+#endif
+#ifndef libc_fesetenvl
+# define libc_fesetenvl default_libc_fesetenv
+#endif
+
+static __always_inline void
+default_libc_feupdateenv (fenv_t *e)
+{
+ (void) feupdateenv (e);
+}
+
+#ifndef libc_feupdateenv
+# define libc_feupdateenv default_libc_feupdateenv
+#endif
+#ifndef libc_feupdateenvf
+# define libc_feupdateenvf default_libc_feupdateenv
+#endif
+#ifndef libc_feupdateenvl
+# define libc_feupdateenvl default_libc_feupdateenv
+#endif
+
+#ifndef libc_feupdateenv_53bit
+# define libc_feupdateenv_53bit libc_feupdateenv
+#endif
+
+static __always_inline int
+default_libc_feupdateenv_test (fenv_t *e, int ex)
+{
+ int ret = fetestexcept (ex);
+ feupdateenv (e);
+ return ret;
+}
+
+#ifndef libc_feupdateenv_test
+# define libc_feupdateenv_test default_libc_feupdateenv_test
+#endif
+#ifndef libc_feupdateenv_testf
+# define libc_feupdateenv_testf default_libc_feupdateenv_test
+#endif
+#ifndef libc_feupdateenv_testl
+# define libc_feupdateenv_testl default_libc_feupdateenv_test
+#endif
+
+/* Save and set the rounding mode. The use of fenv_t to store the old mode
+ allows a target-specific version of this function to avoid converting the
+ rounding mode from the fpu format. By default we have no choice but to
+ manipulate the entire env. */
+
+#ifndef libc_feholdsetround
+# define libc_feholdsetround libc_feholdexcept_setround
+#endif
+#ifndef libc_feholdsetroundf
+# define libc_feholdsetroundf libc_feholdexcept_setroundf
+#endif
+#ifndef libc_feholdsetroundl
+# define libc_feholdsetroundl libc_feholdexcept_setroundl
+#endif
+
+/* ... and the reverse. */
+
+#ifndef libc_feresetround
+# define libc_feresetround libc_feupdateenv
+#endif
+#ifndef libc_feresetroundf
+# define libc_feresetroundf libc_feupdateenvf
+#endif
+#ifndef libc_feresetroundl
+# define libc_feresetroundl libc_feupdateenvl
+#endif
+
+/* ... and a version that may also discard exceptions. */
+
+#ifndef libc_feresetround_noex
+# define libc_feresetround_noex libc_fesetenv
+#endif
+#ifndef libc_feresetround_noexf
+# define libc_feresetround_noexf libc_fesetenvf
+#endif
+#ifndef libc_feresetround_noexl
+# define libc_feresetround_noexl libc_fesetenvl
+#endif
+
+/* Save and restore the rounding mode within a lexical block. */
+
+#define SET_RESTORE_ROUND(RM) \
+ fenv_t __libc_save_rm __attribute__((cleanup(libc_feresetround))); \
+ libc_feholdsetround (&__libc_save_rm, (RM))
+#define SET_RESTORE_ROUNDF(RM) \
+ fenv_t __libc_save_rm __attribute__((cleanup(libc_feresetroundf))); \
+ libc_feholdsetroundf (&__libc_save_rm, (RM))
+#define SET_RESTORE_ROUNDL(RM) \
+ fenv_t __libc_save_rm __attribute__((cleanup(libc_feresetroundl))); \
+ libc_feholdsetroundl (&__libc_save_rm, (RM))
+
+/* Save and restore the rounding mode within a lexical block, and also
+ the set of exceptions raised within the block may be discarded. */
+
+#define SET_RESTORE_ROUND_NOEX(RM) \
+ fenv_t __libc_save_rm __attribute__((cleanup(libc_feresetround_noex))); \
+ libc_feholdsetround (&__libc_save_rm, (RM))
+#define SET_RESTORE_ROUND_NOEXF(RM) \
+ fenv_t __libc_save_rm __attribute__((cleanup(libc_feresetround_noexf))); \
+ libc_feholdsetroundf (&__libc_save_rm, (RM))
+#define SET_RESTORE_ROUND_NOEXL(RM) \
+ fenv_t __libc_save_rm __attribute__((cleanup(libc_feresetround_noexl))); \
+ libc_feholdsetroundl (&__libc_save_rm, (RM))
+
+/* Like SET_RESTORE_ROUND, but also set rounding precision to 53 bits. */
+#define SET_RESTORE_ROUND_53BIT(RM) \
+ fenv_t __libc_save_rm __attribute__((cleanup(libc_feupdateenv_53bit))); \
+ libc_feholdexcept_setround_53bit (&__libc_save_rm, (RM))
#define __nan(str) \
(__builtin_constant_p (str) && str[0] == '\0' ? NAN : __nan (str))
diff --git a/libc/sysdeps/i386/configure b/libc/sysdeps/i386/configure
index 49330e389..baa66096a 100755
--- a/libc/sysdeps/i386/configure
+++ b/libc/sysdeps/i386/configure
@@ -223,11 +223,12 @@ else
(eval $ac_try) 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; }; then
+ test $ac_status = 0; }; }; then :
libc_cv_cc_sse4=yes
else
libc_cv_cc_sse4=no
fi
+
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_cc_sse4" >&5
$as_echo "$libc_cv_cc_sse4" >&6; }
@@ -246,11 +247,12 @@ else
(eval $ac_try) 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; }; then
+ test $ac_status = 0; }; }; then :
libc_cv_as_i686=yes
else
libc_cv_as_i686=no
fi
+
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_as_i686" >&5
$as_echo "$libc_cv_as_i686" >&6; }
@@ -265,11 +267,12 @@ else
(eval $ac_try) 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; }; then
+ test $ac_status = 0; }; }; then :
libc_cv_cc_avx=yes
else
libc_cv_cc_avx=no
fi
+
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_cc_avx" >&5
$as_echo "$libc_cv_cc_avx" >&6; }
@@ -288,11 +291,12 @@ else
(eval $ac_try) 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; }; then
+ test $ac_status = 0; }; }; then :
libc_cv_cc_sse2avx=yes
else
libc_cv_cc_sse2avx=no
fi
+
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_cc_sse2avx" >&5
$as_echo "$libc_cv_cc_sse2avx" >&6; }
@@ -311,11 +315,12 @@ else
(eval $ac_try) 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; }; then
+ test $ac_status = 0; }; }; then :
libc_cv_cc_fma4=yes
else
libc_cv_cc_fma4=no
fi
+
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_cc_fma4" >&5
$as_echo "$libc_cv_cc_fma4" >&6; }
@@ -334,11 +339,12 @@ else
(eval $ac_try) 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; }; then
+ test $ac_status = 0; }; }; then :
libc_cv_cc_novzeroupper=yes
else
libc_cv_cc_novzeroupper=no
fi
+
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_cc_novzeroupper" >&5
$as_echo "$libc_cv_cc_novzeroupper" >&6; }
diff --git a/libc/sysdeps/i386/configure.in b/libc/sysdeps/i386/configure.in
index f769019ac..7b4879d54 100644
--- a/libc/sysdeps/i386/configure.in
+++ b/libc/sysdeps/i386/configure.in
@@ -40,60 +40,48 @@ fi
dnl Check if -msse4 works.
AC_CACHE_CHECK(for SSE4 support, libc_cv_cc_sse4, [dnl
-if AC_TRY_COMMAND([${CC-cc} -msse4 -xc /dev/null -S -o /dev/null]); then
- libc_cv_cc_sse4=yes
-else
- libc_cv_cc_sse4=no
-fi])
+LIBC_TRY_CC_OPTION([-msse4], [libc_cv_cc_sse4=yes], [libc_cv_cc_sse4=no])
+])
if test $libc_cv_cc_sse4 = yes; then
AC_DEFINE(HAVE_SSE4_SUPPORT)
fi
dnl Check if -Wa,-mtune=i686 works.
AC_CACHE_CHECK(for assembler -mtune=i686 support, libc_cv_as_i686, [dnl
-if AC_TRY_COMMAND([${CC-cc} -Wa,-mtune=i686 -xc /dev/null -S -o /dev/null]); then
- libc_cv_as_i686=yes
-else
- libc_cv_as_i686=no
-fi])
+LIBC_TRY_CC_OPTION([-Wa,-mtune=i686],
+ [libc_cv_as_i686=yes],
+ [libc_cv_as_i686=no])
+])
dnl Check if -mavx works.
AC_CACHE_CHECK(for AVX support, libc_cv_cc_avx, [dnl
-if AC_TRY_COMMAND([${CC-cc} -mavx -xc /dev/null -S -o /dev/null]); then
- libc_cv_cc_avx=yes
-else
- libc_cv_cc_avx=no
-fi])
+LIBC_TRY_CC_OPTION([-mavx], [libc_cv_cc_avx=yes], [libc_cv_cc_avx=no])
+])
if test $libc_cv_cc_avx = yes; then
AC_DEFINE(HAVE_AVX_SUPPORT)
fi
dnl Check if -msse2avx works.
AC_CACHE_CHECK(for AVX encoding of SSE instructions, libc_cv_cc_sse2avx, [dnl
-if AC_TRY_COMMAND([${CC-cc} -msse2avx -xc /dev/null -S -o /dev/null]); then
- libc_cv_cc_sse2avx=yes
-else
- libc_cv_cc_sse2avx=no
-fi])
+LIBC_TRY_CC_OPTION([-msse2avx],
+ [libc_cv_cc_sse2avx=yes],
+ [libc_cv_cc_sse2avx=no])
+])
if test $libc_cv_cc_sse2avx = yes; then
AC_DEFINE(HAVE_SSE2AVX_SUPPORT)
fi
dnl Check if -mfma4 works.
AC_CACHE_CHECK(for FMA4 support, libc_cv_cc_fma4, [dnl
-if AC_TRY_COMMAND([${CC-cc} -mfma4 -xc /dev/null -S -o /dev/null]); then
- libc_cv_cc_fma4=yes
-else
- libc_cv_cc_fma4=no
-fi])
+LIBC_TRY_CC_OPTION([-mfma4], [libc_cv_cc_fma4=yes], [libc_cv_cc_fma4=no])
+])
if test $libc_cv_cc_fma4 = yes; then
AC_DEFINE(HAVE_FMA4_SUPPORT)
fi
dnl Check if -mno-vzeroupper works.
AC_CACHE_CHECK(for -mno-vzeroupper support, libc_cv_cc_novzeroupper, [dnl
-if AC_TRY_COMMAND([${CC-cc} -mno-vzeroupper -xc /dev/null -S -o /dev/null]); then
- libc_cv_cc_novzeroupper=yes
-else
- libc_cv_cc_novzeroupper=no
-fi])
+LIBC_TRY_CC_OPTION([-mno-vzeroupper],
+ [libc_cv_cc_novzeroupper=yes],
+ [libc_cv_cc_novzeroupper=no])
+])
diff --git a/libc/sysdeps/i386/fpu/branred.c b/libc/sysdeps/i386/fpu/branred.c
deleted file mode 100644
index 1cc893170..000000000
--- a/libc/sysdeps/i386/fpu/branred.c
+++ /dev/null
@@ -1 +0,0 @@
-/* Not needed. */
diff --git a/libc/sysdeps/i386/fpu/dosincos.c b/libc/sysdeps/i386/fpu/dosincos.c
deleted file mode 100644
index 1cc893170..000000000
--- a/libc/sysdeps/i386/fpu/dosincos.c
+++ /dev/null
@@ -1 +0,0 @@
-/* Not needed. */
diff --git a/libc/sysdeps/i386/fpu/e_pow.S b/libc/sysdeps/i386/fpu/e_pow.S
index 63c44f135..1abedf628 100644
--- a/libc/sysdeps/i386/fpu/e_pow.S
+++ b/libc/sysdeps/i386/fpu/e_pow.S
@@ -230,6 +230,16 @@ ENTRY(__ieee754_pow)
testb $2, %dh
jz 16f // jump if x == +inf
+ // fistpll raises invalid exception for |y| >= 1L<<63, so test
+ // that (in which case y is certainly even) before testing
+ // whether y is odd.
+ fld %st // y : y
+ fabs // |y| : y
+ fcompl MO(p63) // y
+ fnstsw
+ sahf
+ jnc 16f
+
// We must find out whether y is an odd integer.
fld %st // y : y
fistpll (%esp) // y
@@ -239,20 +249,13 @@ ENTRY(__ieee754_pow)
sahf
jne 17f
- // OK, the value is an integer, but is the number of bits small
- // enough so that all are coming from the mantissa?
+ // OK, the value is an integer.
popl %eax
cfi_adjust_cfa_offset (-4)
popl %edx
cfi_adjust_cfa_offset (-4)
andb $1, %al
jz 18f // jump if not odd
- movl %edx, %eax
- orl %edx, %edx
- jns 155f
- negl %eax
-155: cmpl $0x00200000, %eax
- ja 18f // does not fit in mantissa bits
// It's an odd integer.
shrl $31, %edx
fldl MOX(minf_mzero, %edx, 8)
@@ -289,6 +292,16 @@ ENTRY(__ieee754_pow)
testb $2, %dh
jz 25f
+ // fistpll raises invalid exception for |y| >= 1L<<63, so test
+ // that (in which case y is certainly even) before testing
+ // whether y is odd.
+ fld %st // y : y
+ fabs // |y| : y
+ fcompl MO(p63) // y
+ fnstsw
+ sahf
+ jnc 25f
+
fld %st // y : y
fistpll (%esp) // y
fildll (%esp) // int(y) : y
@@ -297,16 +310,13 @@ ENTRY(__ieee754_pow)
sahf
jne 26f
- // OK, the value is an integer, but is the number of bits small
- // enough so that all are coming from the mantissa?
+ // OK, the value is an integer.
popl %eax
cfi_adjust_cfa_offset (-4)
popl %edx
cfi_adjust_cfa_offset (-4)
andb $1, %al
jz 27f // jump if not odd
- cmpl $0xffe00000, %edx
- jbe 27f // does not fit in mantissa bits
// It's an odd integer.
// Raise divide-by-zero exception and get minus infinity value.
fldl MO(one)
@@ -329,6 +339,14 @@ ENTRY(__ieee754_pow)
21: testb $2, %dh
jz 22f
+ // fistpll raises invalid exception for |y| >= 1L<<63, so test
+ // that (in which case y is certainly even) before testing
+ // whether y is odd.
+ fcoml MO(p63) // y
+ fnstsw
+ sahf
+ jnc 22f
+
fld %st // y : y
fistpll (%esp) // y
fildll (%esp) // int(y) : y
@@ -337,16 +355,13 @@ ENTRY(__ieee754_pow)
sahf
jne 23f
- // OK, the value is an integer, but is the number of bits small
- // enough so that all are coming from the mantissa?
+ // OK, the value is an integer.
popl %eax
cfi_adjust_cfa_offset (-4)
popl %edx
cfi_adjust_cfa_offset (-4)
andb $1, %al
jz 24f // jump if not odd
- cmpl $0xffe00000, %edx
- jae 24f // does not fit in mantissa bits
// It's an odd integer.
fldl MO(mzero)
ret
diff --git a/libc/sysdeps/i386/fpu/e_powf.S b/libc/sysdeps/i386/fpu/e_powf.S
index cc8456d28..aa58ed2b6 100644
--- a/libc/sysdeps/i386/fpu/e_powf.S
+++ b/libc/sysdeps/i386/fpu/e_powf.S
@@ -224,6 +224,16 @@ ENTRY(__ieee754_powf)
testb $2, %dh
jz 16f // jump if x == +inf
+ // fistpl raises invalid exception for |y| >= 1L<<31, so test
+ // that (in which case y is certainly even) before testing
+ // whether y is odd.
+ fld %st // y : y
+ fabs // |y| : y
+ fcompl MO(p31) // y
+ fnstsw
+ sahf
+ jnc 16f
+
// We must find out whether y is an odd integer.
fld %st // y : y
fistpl (%esp) // y
@@ -233,18 +243,11 @@ ENTRY(__ieee754_powf)
sahf
jne 17f
- // OK, the value is an integer, but is the number of bits small
- // enough so that all are coming from the mantissa?
+ // OK, the value is an integer.
popl %edx
cfi_adjust_cfa_offset (-4)
testb $1, %dl
jz 18f // jump if not odd
- movl %edx, %eax
- orl %edx, %edx
- jns 155f
- negl %eax
-155: cmpl $0x01000000, %eax
- ja 18f // does not fit in mantissa bits
// It's an odd integer.
shrl $31, %edx
fldl MOX(minf_mzero, %edx, 8)
@@ -281,6 +284,16 @@ ENTRY(__ieee754_powf)
testb $2, %dh
jz 25f
+ // fistpl raises invalid exception for |y| >= 1L<<31, so test
+ // that (in which case y is certainly even) before testing
+ // whether y is odd.
+ fld %st // y : y
+ fabs // |y| : y
+ fcompl MO(p31) // y
+ fnstsw
+ sahf
+ jnc 25f
+
fld %st // y : y
fistpl (%esp) // y
fildl (%esp) // int(y) : y
@@ -289,14 +302,11 @@ ENTRY(__ieee754_powf)
sahf
jne 26f
- // OK, the value is an integer, but is the number of bits small
- // enough so that all are coming from the mantissa?
+ // OK, the value is an integer.
popl %edx
cfi_adjust_cfa_offset (-4)
testb $1, %dl
jz 27f // jump if not odd
- cmpl $0xff000000, %edx
- jbe 27f // does not fit in mantissa bits
// It's an odd integer.
// Raise divide-by-zero exception and get minus infinity value.
fldl MO(one)
@@ -319,6 +329,14 @@ ENTRY(__ieee754_powf)
21: testb $2, %dh
jz 22f
+ // fistpl raises invalid exception for |y| >= 1L<<31, so test
+ // that (in which case y is certainly even) before testing
+ // whether y is odd.
+ fcoml MO(p31) // y
+ fnstsw
+ sahf
+ jnc 22f
+
fld %st // y : y
fistpl (%esp) // y
fildl (%esp) // int(y) : y
@@ -327,14 +345,11 @@ ENTRY(__ieee754_powf)
sahf
jne 23f
- // OK, the value is an integer, but is the number of bits small
- // enough so that all are coming from the mantissa?
+ // OK, the value is an integer.
popl %edx
cfi_adjust_cfa_offset (-4)
testb $1, %dl
jz 24f // jump if not odd
- cmpl $0xff000000, %edx
- jae 24f // does not fit in mantissa bits
// It's an odd integer.
fldl MO(mzero)
ret
diff --git a/libc/sysdeps/i386/fpu/e_powl.S b/libc/sysdeps/i386/fpu/e_powl.S
index 5d850897c..c0aa194c6 100644
--- a/libc/sysdeps/i386/fpu/e_powl.S
+++ b/libc/sysdeps/i386/fpu/e_powl.S
@@ -32,6 +32,9 @@ limit: .double 0.29
ASM_TYPE_DIRECTIVE(p63,@object)
p63: .byte 0, 0, 0, 0, 0, 0, 0xe0, 0x43
ASM_SIZE_DIRECTIVE(p63)
+ ASM_TYPE_DIRECTIVE(p64,@object)
+p64: .byte 0, 0, 0, 0, 0, 0, 0xf0, 0x43
+ ASM_SIZE_DIRECTIVE(p64)
.section .rodata.cst16,"aM",@progbits,16
@@ -243,6 +246,19 @@ ENTRY(__ieee754_powl)
testb $2, %dh
jz 16f // jump if x == +inf
+ // fistpll raises invalid exception for |y| >= 1L<<63, but y
+ // may be odd unless we know |y| >= 1L<<64.
+ fld %st // y : y
+ fabs // |y| : y
+ fcompl MO(p64) // y
+ fnstsw
+ sahf
+ jnc 16f
+ fldl MO(p63) // p63 : y
+ fxch // y : p63
+ fprem // y%p63 : p63
+ fstp %st(1) // y%p63
+
// We must find out whether y is an odd integer.
fld %st // y : y
fistpll (%esp) // y
@@ -295,6 +311,19 @@ ENTRY(__ieee754_powl)
testb $2, %dh
jz 25f
+ // fistpll raises invalid exception for |y| >= 1L<<63, but y
+ // may be odd unless we know |y| >= 1L<<64.
+ fld %st // y : y
+ fabs // |y| : y
+ fcompl MO(p64) // y
+ fnstsw
+ sahf
+ jnc 25f
+ fldl MO(p63) // p63 : y
+ fxch // y : p63
+ fprem // y%p63 : p63
+ fstp %st(1) // y%p63
+
fld %st // y : y
fistpll (%esp) // y
fildll (%esp) // int(y) : y
@@ -332,6 +361,18 @@ ENTRY(__ieee754_powl)
21: testb $2, %dh
jz 22f
+ // fistpll raises invalid exception for |y| >= 1L<<63, but y
+ // may be odd unless we know |y| >= 1L<<64.
+ fld %st // y : y
+ fcompl MO(p64) // y
+ fnstsw
+ sahf
+ jnc 22f
+ fldl MO(p63) // p63 : y
+ fxch // y : p63
+ fprem // y%p63 : p63
+ fstp %st(1) // y%p63
+
fld %st // y : y
fistpll (%esp) // y
fildll (%esp) // int(y) : y
diff --git a/libc/sysdeps/i386/fpu/e_rem_pio2f.c b/libc/sysdeps/i386/fpu/e_rem_pio2f.c
deleted file mode 100644
index 1347b0468..000000000
--- a/libc/sysdeps/i386/fpu/e_rem_pio2f.c
+++ /dev/null
@@ -1,3 +0,0 @@
-/* Empty. This file is only meant to avoid compiling the file with the
- same name in the libm-ieee754 directory. The code is not used since
- there is an assembler version for all users of this file. */
diff --git a/libc/sysdeps/i386/fpu/e_rem_pio2l.c b/libc/sysdeps/i386/fpu/e_rem_pio2l.c
deleted file mode 100644
index 1347b0468..000000000
--- a/libc/sysdeps/i386/fpu/e_rem_pio2l.c
+++ /dev/null
@@ -1,3 +0,0 @@
-/* Empty. This file is only meant to avoid compiling the file with the
- same name in the libm-ieee754 directory. The code is not used since
- there is an assembler version for all users of this file. */
diff --git a/libc/sysdeps/i386/fpu/feholdexcpt.c b/libc/sysdeps/i386/fpu/feholdexcpt.c
index a09d45ebd..7e1038955 100644
--- a/libc/sysdeps/i386/fpu/feholdexcpt.c
+++ b/libc/sysdeps/i386/fpu/feholdexcpt.c
@@ -1,6 +1,5 @@
/* Store current floating-point environment and clear exceptions.
- Copyright (C) 1997, 1999, 2003, 2004, 2005, 2007
- Free Software Foundation, Inc.
+ Copyright (C) 1997-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -26,19 +25,9 @@
int
feholdexcept (fenv_t *envp)
{
- fenv_t temp;
-
- /* Store the environment. */
- __asm__ ("fnstenv %0" : "=m" (temp));
- *envp = temp;
-
- /* Now set all exceptions to non-stop. */
- temp.__control_word |= 0x3f;
-
- /* And clear all exceptions. */
- temp.__status_word &= ~0x3f;
-
- __asm__ ("fldenv %0" : : "m" (temp));
+ /* Store the environment. Recall that fnstenv has a side effect of
+ masking all exceptions. Then clear all exceptions. */
+ __asm__ volatile ("fnstenv %0; fnclex" : "=m" (*envp));
/* If the CPU supports SSE we set the MXCSR as well. */
if ((GLRO(dl_hwcap) & HWCAP_I386_XMM) != 0)
diff --git a/libc/sysdeps/i386/fpu/fenv_private.h b/libc/sysdeps/i386/fpu/fenv_private.h
new file mode 100644
index 000000000..f33f57c39
--- /dev/null
+++ b/libc/sysdeps/i386/fpu/fenv_private.h
@@ -0,0 +1,304 @@
+#ifndef FENV_PRIVATE_H
+#define FENV_PRIVATE_H 1
+
+#include <fenv.h>
+#include <fpu_control.h>
+
+#ifdef __SSE2_MATH__
+# define math_opt_barrier(x) \
+ ({ __typeof(x) __x; \
+ if (sizeof (x) <= sizeof (double)) \
+ __asm ("" : "=x" (__x) : "0" (x)); \
+ else \
+ __asm ("" : "=t" (__x) : "0" (x)); \
+ __x; })
+# define math_force_eval(x) \
+ do { \
+ if (sizeof (x) <= sizeof (double)) \
+ __asm __volatile ("" : : "x" (x)); \
+ else \
+ __asm __volatile ("" : : "f" (x)); \
+ } while (0)
+#else
+# define math_opt_barrier(x) \
+ ({ __typeof (x) __x; \
+ __asm ("" : "=t" (__x) : "0" (x)); \
+ __x; })
+# define math_force_eval(x) \
+ do { \
+ __typeof (x) __x = (x); \
+ if (sizeof (x) <= sizeof (double)) \
+ __asm __volatile ("" : : "m" (__x)); \
+ else \
+ __asm __volatile ("" : : "f" (__x)); \
+ } while (0)
+#endif
+
+/* This file is used by both the 32- and 64-bit ports. The 64-bit port
+ has a field in the fenv_t for the mxcsr; the 32-bit port does not.
+ Instead, we (ab)use the only 32-bit field extant in the struct. */
+#ifndef __x86_64__
+# define __mxcsr __eip
+#endif
+
+
+/* All of these functions are private to libm, and are all used in pairs
+ to save+change the fp state and restore the original state. Thus we
+ need not care for both the 387 and the sse unit, only the one we're
+ actually using. */
+
+#if defined __AVX__ || defined SSE2AVX
+# define STMXCSR "vstmxcsr"
+# define LDMXCSR "vldmxcsr"
+#else
+# define STMXCSR "stmxcsr"
+# define LDMXCSR "ldmxcsr"
+#endif
+
+static __always_inline void
+libc_feholdexcept_sse (fenv_t *e)
+{
+ unsigned int mxcsr;
+ asm (STMXCSR " %0" : "=m" (*&mxcsr));
+ e->__mxcsr = mxcsr;
+ mxcsr = (mxcsr | 0x1f80) & ~0x3f;
+ asm volatile (LDMXCSR " %0" : : "m" (*&mxcsr));
+}
+
+static __always_inline void
+libc_feholdexcept_387 (fenv_t *e)
+{
+ /* Recall that fnstenv has a side-effect of masking exceptions.
+ Clobber all of the fp registers so that the TOS field is 0. */
+ asm volatile ("fnstenv %0; fnclex"
+ : "=m"(*e)
+ : : "st", "st(1)", "st(2)", "st(3)",
+ "st(4)", "st(5)", "st(6)", "st(7)");
+}
+
+static __always_inline void
+libc_feholdexcept_setround_sse (fenv_t *e, int r)
+{
+ unsigned int mxcsr;
+ asm (STMXCSR " %0" : "=m" (*&mxcsr));
+ e->__mxcsr = mxcsr;
+ mxcsr = ((mxcsr | 0x1f80) & ~0x603f) | (r << 3);
+ asm volatile (LDMXCSR " %0" : : "m" (*&mxcsr));
+}
+
+/* Set both rounding mode and precision. A convenience function for use
+ by libc_feholdexcept_setround and libc_feholdexcept_setround_53bit. */
+static __always_inline void
+libc_feholdexcept_setround_387_prec (fenv_t *e, int r)
+{
+ libc_feholdexcept_387 (e);
+
+ fpu_control_t cw = e->__control_word;
+ cw &= ~(_FPU_RC_ZERO | _FPU_EXTENDED);
+ cw |= r | 0x3f;
+ _FPU_SETCW (cw);
+}
+
+static __always_inline void
+libc_feholdexcept_setround_387 (fenv_t *e, int r)
+{
+ libc_feholdexcept_setround_387_prec (e, r | _FPU_EXTENDED);
+}
+
+static __always_inline void
+libc_feholdexcept_setround_387_53bit (fenv_t *e, int r)
+{
+ libc_feholdexcept_setround_387_prec (e, r | _FPU_DOUBLE);
+}
+
+static __always_inline int
+libc_fetestexcept_sse (int e)
+{
+ unsigned int mxcsr;
+ asm volatile (STMXCSR " %0" : "=m" (*&mxcsr));
+ return mxcsr & e & FE_ALL_EXCEPT;
+}
+
+static __always_inline int
+libc_fetestexcept_387 (int ex)
+{
+ fexcept_t temp;
+ asm volatile ("fnstsw %0" : "=a" (temp));
+ return temp & ex & FE_ALL_EXCEPT;
+}
+
+static __always_inline void
+libc_fesetenv_sse (fenv_t *e)
+{
+ asm volatile (LDMXCSR " %0" : : "m" (e->__mxcsr));
+}
+
+static __always_inline void
+libc_fesetenv_387 (fenv_t *e)
+{
+ /* Clobber all fp registers so that the TOS value we saved earlier is
+ compatible with the current state of the compiler. */
+ asm volatile ("fldenv %0"
+ : : "m" (*e)
+ : "st", "st(1)", "st(2)", "st(3)",
+ "st(4)", "st(5)", "st(6)", "st(7)");
+}
+
+static __always_inline int
+libc_feupdateenv_test_sse (fenv_t *e, int ex)
+{
+ unsigned int mxcsr, old_mxcsr, cur_ex;
+ asm volatile (STMXCSR " %0" : "=m" (*&mxcsr));
+ cur_ex = mxcsr & FE_ALL_EXCEPT;
+
+ /* Merge current exceptions with the old environment. */
+ old_mxcsr = e->__mxcsr;
+ mxcsr = old_mxcsr | cur_ex;
+ asm volatile (LDMXCSR " %0" : : "m" (*&mxcsr));
+
+ /* Raise SIGFPE for any new exceptions since the hold. Expect that
+ the normal environment has all exceptions masked. */
+ if (__builtin_expect ((old_mxcsr >> 7) & cur_ex, 0))
+ __feraiseexcept (cur_ex);
+
+ /* Test for exceptions raised since the hold. */
+ return cur_ex & ex;
+}
+
+static __always_inline int
+libc_feupdateenv_test_387 (fenv_t *e, int ex)
+{
+ fexcept_t cur_ex;
+
+ /* Save current exceptions. */
+ asm volatile ("fnstsw %0" : "=a" (cur_ex));
+ cur_ex &= FE_ALL_EXCEPT;
+
+ /* Reload original environment. */
+ libc_fesetenv_387 (e);
+
+ /* Merge current exceptions. */
+ __feraiseexcept (cur_ex);
+
+ /* Test for exceptions raised since the hold. */
+ return cur_ex & ex;
+}
+
+static __always_inline void
+libc_feupdateenv_sse (fenv_t *e)
+{
+ libc_feupdateenv_test_sse (e, 0);
+}
+
+static __always_inline void
+libc_feupdateenv_387 (fenv_t *e)
+{
+ libc_feupdateenv_test_387 (e, 0);
+}
+
+static __always_inline void
+libc_feholdsetround_sse (fenv_t *e, int r)
+{
+ unsigned int mxcsr;
+ asm (STMXCSR " %0" : "=m" (*&mxcsr));
+ e->__mxcsr = mxcsr;
+ mxcsr = (mxcsr & ~0x6000) | (r << 3);
+ asm volatile (LDMXCSR " %0" : : "m" (*&mxcsr));
+}
+
+static __always_inline void
+libc_feholdsetround_387_prec (fenv_t *e, int r)
+{
+ fpu_control_t cw;
+
+ _FPU_GETCW (cw);
+ e->__control_word = cw;
+ cw &= ~(_FPU_RC_ZERO | _FPU_EXTENDED);
+ cw |= r;
+ _FPU_SETCW (cw);
+}
+
+static __always_inline void
+libc_feholdsetround_387 (fenv_t *e, int r)
+{
+ libc_feholdsetround_387_prec (e, r | _FPU_EXTENDED);
+}
+
+static __always_inline void
+libc_feholdsetround_387_53bit (fenv_t *e, int r)
+{
+ libc_feholdsetround_387_prec (e, r | _FPU_DOUBLE);
+}
+
+static __always_inline void
+libc_feresetround_sse (fenv_t *e)
+{
+ unsigned int mxcsr;
+ asm (STMXCSR " %0" : "=m" (*&mxcsr));
+ mxcsr = (mxcsr & ~0x6000) | (e->__mxcsr & 0x6000);
+ asm volatile (LDMXCSR " %0" : : "m" (*&mxcsr));
+}
+
+static __always_inline void
+libc_feresetround_387 (fenv_t *e)
+{
+ _FPU_SETCW (e->__control_word);
+}
+
+#ifdef __SSE_MATH__
+# define libc_feholdexceptf libc_feholdexcept_sse
+# define libc_feholdexcept_setroundf libc_feholdexcept_setround_sse
+# define libc_fetestexceptf libc_fetestexcept_sse
+# define libc_fesetenvf libc_fesetenv_sse
+# define libc_feupdateenv_testf libc_feupdateenv_test_sse
+# define libc_feupdateenvf libc_feupdateenv_sse
+# define libc_feholdsetroundf libc_feholdsetround_sse
+# define libc_feresetroundf libc_feresetround_sse
+#else
+# define libc_feholdexceptf libc_feholdexcept_387
+# define libc_feholdexcept_setroundf libc_feholdexcept_setround_387
+# define libc_fetestexceptf libc_fetestexcept_387
+# define libc_fesetenvf libc_fesetenv_387
+# define libc_feupdateenv_testf libc_feupdateenv_test_387
+# define libc_feupdateenvf libc_feupdateenv_387
+# define libc_feholdsetroundf libc_feholdsetround_387
+# define libc_feresetroundf libc_feresetround_387
+#endif /* __SSE_MATH__ */
+
+#ifdef __SSE2_MATH__
+# define libc_feholdexcept libc_feholdexcept_sse
+# define libc_feholdexcept_setround libc_feholdexcept_setround_sse
+# define libc_fetestexcept libc_fetestexcept_sse
+# define libc_fesetenv libc_fesetenv_sse
+# define libc_feupdateenv_test libc_feupdateenv_test_sse
+# define libc_feupdateenv libc_feupdateenv_sse
+# define libc_feholdsetround libc_feholdsetround_sse
+# define libc_feresetround libc_feresetround_sse
+#else
+# define libc_feholdexcept libc_feholdexcept_387
+# define libc_feholdexcept_setround libc_feholdexcept_setround_387
+# define libc_fetestexcept libc_fetestexcept_387
+# define libc_fesetenv libc_fesetenv_387
+# define libc_feupdateenv_test libc_feupdateenv_test_387
+# define libc_feupdateenv libc_feupdateenv_387
+# define libc_feholdsetround libc_feholdsetround_387
+# define libc_feresetround libc_feresetround_387
+#endif /* __SSE2_MATH__ */
+
+#define libc_feholdexceptl libc_feholdexcept_387
+#define libc_feholdexcept_setroundl libc_feholdexcept_setround_387
+#define libc_fetestexceptl libc_fetestexcept_387
+#define libc_fesetenvl libc_fesetenv_387
+#define libc_feupdateenv_testl libc_feupdateenv_test_387
+#define libc_feupdateenvl libc_feupdateenv_387
+#define libc_feholdsetroundl libc_feholdsetround_387
+#define libc_feresetroundl libc_feresetround_387
+
+#ifndef __SSE2_MATH__
+# define libc_feholdexcept_setround_53bit libc_feholdexcept_setround_387_53bit
+# define libc_feholdsetround_53bit libc_feholdsetround_387_53bit
+#endif
+
+#undef __mxcsr
+
+#endif /* FENV_PRIVATE_H */
diff --git a/libc/sysdeps/i386/fpu/k_rem_pio2.c b/libc/sysdeps/i386/fpu/k_rem_pio2.c
deleted file mode 100644
index 1347b0468..000000000
--- a/libc/sysdeps/i386/fpu/k_rem_pio2.c
+++ /dev/null
@@ -1,3 +0,0 @@
-/* Empty. This file is only meant to avoid compiling the file with the
- same name in the libm-ieee754 directory. The code is not used since
- there is an assembler version for all users of this file. */
diff --git a/libc/sysdeps/i386/fpu/k_rem_pio2f.c b/libc/sysdeps/i386/fpu/k_rem_pio2f.c
deleted file mode 100644
index 1347b0468..000000000
--- a/libc/sysdeps/i386/fpu/k_rem_pio2f.c
+++ /dev/null
@@ -1,3 +0,0 @@
-/* Empty. This file is only meant to avoid compiling the file with the
- same name in the libm-ieee754 directory. The code is not used since
- there is an assembler version for all users of this file. */
diff --git a/libc/sysdeps/i386/fpu/libm-test-ulps b/libc/sysdeps/i386/fpu/libm-test-ulps
index 977a3abd1..4d61635f2 100644
--- a/libc/sysdeps/i386/fpu/libm-test-ulps
+++ b/libc/sysdeps/i386/fpu/libm-test-ulps
@@ -431,15 +431,44 @@ idouble: 1
ifloat: 1
# cexp
+Test "Real part of: cexp (-10000 + 0x1p16383 i) == 1.045876464564882298442774542991176546722e-4343 + 4.421154026488516836023811173959413420548e-4344 i":
+ildouble: 1
+ldouble: 1
Test "Real part of: cexp (-2.0 - 3.0 i) == -0.13398091492954261346140525546115575 - 0.019098516261135196432576240858800925 i":
ildouble: 1
ldouble: 1
Test "Imaginary part of: cexp (-2.0 - 3.0 i) == -0.13398091492954261346140525546115575 - 0.019098516261135196432576240858800925 i":
+float: 1
+ifloat: 1
ildouble: 1
ldouble: 1
+Test "Imaginary part of: cexp (0 + 0x1p65 i) == 0.99888622066058013610642172179340364209972 - 0.047183876212354673805106149805700013943218 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: cexp (0 - 0x1p65 i) == 0.99888622066058013610642172179340364209972 + 0.047183876212354673805106149805700013943218 i":
+float: 1
+ifloat: 1
Test "Real part of: cexp (0.75 + 1.25 i) == 0.667537446429131586942201977015932112 + 2.00900045494094876258347228145863909 i":
+float: 1
+ifloat: 1
ildouble: 1
ldouble: 1
+Test "Imaginary part of: cexp (0.75 + 1.25 i) == 0.667537446429131586942201977015932112 + 2.00900045494094876258347228145863909 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: cexp (50 + 0x1p127 i) == 4.053997150228616856622417636046265337193e21 + 3.232070315463388524466674772633810238819e21 i":
+double: 2
+idouble: 2
+Test "Imaginary part of: cexp (50 + 0x1p127 i) == 4.053997150228616856622417636046265337193e21 + 3.232070315463388524466674772633810238819e21 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: cexp (500 + 0x1p1023 i) == -1.159886268932754433233243794561351783426e217 + 7.904017694554466595359379965081774849708e216 i":
+double: 1
+idouble: 1
# clog
Test "Real part of: clog (0.75 + 1.25 i) == 0.376885901188190075998919126749298416 + 1.03037682652431246378774332703115153 i":
@@ -447,6 +476,21 @@ float: 1
ifloat: 1
ildouble: 1
ldouble: 1
+Test "Real part of: clog (0x1.fffffep+127 + 0x1.fffffep+127 i) == 89.06941264234832570836679262104313101776 + pi/4 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog (0x1.fp+16383 + 0x1.fp+16383 i) == 11356.83823118610934184548269774874545400 + pi/4 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog (0x1.fp+16383 + 0x1p+16383 i) == 11356.60974243783798653123798337822335902 + 0.4764674194737066993385333770295162295856 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog (0x1p-1074 + 0x1p-1074 i) == -744.0934983311012896593986823853525458290 + pi/4 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog (0x1p-149 + 0x1p-149 i) == -102.9323563131518784484589700365392203592 + pi/4 i":
+ildouble: 1
+ldouble: 1
# clog10
Test "Imaginary part of: clog10 (-0 + inf i) == inf + pi/2*log10(e) i":
@@ -514,6 +558,51 @@ idouble: 1
ifloat: 1
ildouble: 1
ldouble: 1
+Test "Real part of: clog10 (0x1.fffffep+127 + 0x1.fffffep+127 i) == 38.68235441693561449174780668781319348761 + pi/4*log10(e) i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (0x1.fffffep+127 + 0x1.fffffep+127 i) == 38.68235441693561449174780668781319348761 + pi/4*log10(e) i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Imaginary part of: clog10 (0x1.fffffffffffffp+1023 + 0x1.fffffffffffffp+1023 i) == 308.4052305577487344482591243175787477115 + pi/4*log10(e) i":
+double: 1
+idouble: 1
+Test "Real part of: clog10 (0x1.fffffffffffffp+1023 + 0x1p+1023 i) == 308.3031705664207720674749211936626341569 + 0.2013595981366865903254995612594728746470 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog10 (0x1.fp+16383 + 0x1.fp+16383 i) == 4932.212175672014259683102930239951947672 + pi/4*log10(e) i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog10 (0x1.fp+16383 + 0x1p+16383 i) == 4932.112944269463028900262609694408579449 + 0.2069271710841128115912940666587802677383 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (0x1p-1073 + 0x1p-1073 i) == -322.8546703496198318667349645920187712089 + pi/4*log10(e) i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (0x1p-1074 + 0x1p-1074 i) == -323.1557003452838130619487034867432642357 + pi/4*log10(e) i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (0x1p-147 + 0x1p-147 i) == -44.10089436477324509881274807713822842154 + pi/4*log10(e) i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Real part of: clog10 (0x1p-149 + 0x1p-149 i) == -44.70295435610120748924022586658721447508 + pi/4*log10(e) i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (0x1p-149 + 0x1p-149 i) == -44.70295435610120748924022586658721447508 + pi/4*log10(e) i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Real part of: clog10 (0x1p-16440 + 0x1p-16441 i) == -4948.884673709346821106688037612752099609 + 0.2013595981366865710389502301937289472543 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (0x1p-16440 + 0x1p-16441 i) == -4948.884673709346821106688037612752099609 + 0.2013595981366865710389502301937289472543 i":
+ildouble: 1
+ldouble: 1
Test "Imaginary part of: clog10 (3 + inf i) == inf + pi/2*log10(e) i":
double: 1
float: 1
@@ -559,7 +648,9 @@ ldouble: 1
# cos_downward
Test "cos_downward (1) == 0.5403023058681397174009366074429766037323":
double: 1
+float: 2
idouble: 1
+ifloat: 2
ildouble: 1
ldouble: 1
Test "cos_downward (10) == -0.8390715290764524522588639478240648345199":
@@ -567,9 +658,18 @@ double: 1
float: 1
idouble: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "cos_downward (2) == -0.4161468365471423869975682295007621897660":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
Test "cos_downward (3) == -0.9899924966004454572715727947312613023937":
double: 1
idouble: 1
+ildouble: 1
+ldouble: 1
Test "cos_downward (4) == -0.6536436208636119146391681830977503814241":
float: 1
ifloat: 1
@@ -584,6 +684,8 @@ ifloat: 1
ildouble: 1
ldouble: 1
Test "cos_downward (8) == -0.1455000338086135258688413818311946826093":
+float: 1
+ifloat: 1
ildouble: 1
ldouble: 1
Test "cos_downward (9) == -0.9111302618846769883682947111811653112463":
@@ -595,6 +697,9 @@ ildouble: 1
ldouble: 1
# cos_tonearest
+Test "cos_tonearest (2) == -0.4161468365471423869975682295007621897660":
+float: 1
+ifloat: 1
Test "cos_tonearest (8) == -0.1455000338086135258688413818311946826093":
ildouble: 1
ldouble: 1
@@ -639,6 +744,8 @@ double: 1
float: 1
idouble: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
# cos_upward
Test "cos_upward (1) == 0.5403023058681397174009366074429766037323":
@@ -662,6 +769,8 @@ ldouble: 1
Test "cos_upward (4) == -0.6536436208636119146391681830977503814241":
double: 1
idouble: 1
+ildouble: 1
+ldouble: 1
Test "cos_upward (5) == 0.2836621854632262644666391715135573083344":
double: 1
idouble: 1
@@ -682,6 +791,11 @@ double: 1
float: 1
idouble: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "cos_upward (9) == -0.9111302618846769883682947111811653112463":
+ildouble: 1
+ldouble: 1
# cosh
Test "cosh (0.75) == 1.29468328467684468784170818539018176":
@@ -730,18 +844,22 @@ ifloat: 1
ildouble: 1
ldouble: 1
Test "Imaginary part of: cpow (0.75 + 1.25 i, 0.0 + 1.0 i) == 0.331825439177608832276067945276730566 + 0.131338600281188544930936345230903032 i":
+float: 1
+ifloat: 1
ildouble: 1
ldouble: 1
Test "Real part of: cpow (0.75 + 1.25 i, 0.75 + 1.25 i) == 0.117506293914473555420279832210420483 + 0.346552747708338676483025352060418001 i":
-float: 3
-ifloat: 3
+double: 1
+float: 4
+idouble: 1
+ifloat: 4
ildouble: 6
ldouble: 6
Test "Imaginary part of: cpow (0.75 + 1.25 i, 0.75 + 1.25 i) == 0.117506293914473555420279832210420483 + 0.346552747708338676483025352060418001 i":
float: 1
ifloat: 1
-ildouble: 1
-ldouble: 1
+ildouble: 2
+ldouble: 2
Test "Real part of: cpow (0.75 + 1.25 i, 1.0 + 0.0 i) == 0.75 + 1.25 i":
ildouble: 1
ldouble: 1
@@ -749,22 +867,27 @@ Test "Imaginary part of: cpow (0.75 + 1.25 i, 1.0 + 0.0 i) == 0.75 + 1.25 i":
float: 1
ifloat: 1
Test "Real part of: cpow (0.75 + 1.25 i, 1.0 + 1.0 i) == 0.0846958290317209430433805274189191353 + 0.513285749182902449043287190519090481 i":
-double: 1
+double: 2
float: 3
-idouble: 1
+idouble: 2
ifloat: 3
ildouble: 3
ldouble: 3
+Test "Real part of: cpow (2 + 0 i, 10 + 0 i) == 1024.0 + 0.0 i":
+ildouble: 1
+ldouble: 1
Test "Real part of: cpow (2 + 3 i, 4 + 0 i) == -119.0 - 120.0 i":
double: 1
-float: 4
+float: 5
idouble: 1
-ifloat: 4
+ifloat: 5
+ildouble: 1
+ldouble: 1
Test "Imaginary part of: cpow (2 + 3 i, 4 + 0 i) == -119.0 - 120.0 i":
-float: 1
-ifloat: 1
-ildouble: 2
-ldouble: 2
+float: 2
+ifloat: 2
+ildouble: 4
+ldouble: 4
Test "Imaginary part of: cpow (e + 0 i, 0 + 2 * M_PIl i) == 1.0 + 0.0 i":
double: 2
float: 3
@@ -774,6 +897,9 @@ ildouble: 1
ldouble: 1
# csin
+Test "Imaginary part of: csin (-2 - 3 i) == -9.15449914691142957346729954460983256 + 4.16890695996656435075481305885375484 i":
+float: 1
+ifloat: 1
Test "Real part of: csin (0.75 + 1.25 i) == 1.28722291002649188575873510790565441 + 1.17210635989270256101081285116138863 i":
float: 1
ifloat: 1
@@ -805,6 +931,26 @@ Test "Imaginary part of: csinh (0.75 + 1.25 i) == 0.2592948545511627791533498306
float: 1
ifloat: 1
+# csqrt
+Test "Imaginary part of: csqrt (0x1.fffffffffffffp+1023 + 0x1p+1023 i) == 1.379778091031440685006200821918878702861e+154 + 3.257214233483129514781233066898042490248e+153 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: csqrt (0x1.fp+16383 + 0x1.fp+16383 i) == 1.179514222452201722651836720466795901016e+2466 + 4.885707879516577666702435054303191575148e+2465 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: csqrt (0x1p-1073 + 0x1p-1073 i) == 3.453664695497464982856905711457966660085e-162 + 1.430554756764195530630723976279903095110e-162 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: csqrt (0x1p-1074 + 0x1p-1074 i) == 2.442109726130830256743814843868934877597e-162 + 1.011554969366634726113090867589031782487e-162 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: csqrt (0x1p-147 + 0x1p-147 i) == 8.225610928685557596194006925540350401606e-23 + 3.407159605465907500737319471202779419102e-23 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: csqrt (0x1p-149 + 0x1p-149 i) == 4.112805464342778798097003462770175200803e-23 + 1.703579802732953750368659735601389709551e-23 i":
+ildouble: 1
+ldouble: 1
+
# ctan
Test "Real part of: ctan (-2 - 3 i) == 0.376402564150424829275122113032269084e-2 - 1.00323862735360980144635859782192726 i":
double: 1
@@ -976,13 +1122,19 @@ Test "hypot (12.4, 0.7) == 12.419742348374220601176836866763271":
float: 1
# j0
+Test "j0 (-0x1.001000001p+593) == -3.927269966354206207832593635798954916263e-90":
+ildouble: 2
+ldouble: 2
Test "j0 (-4.0) == -3.9714980986384737228659076845169804197562E-1":
double: 1
float: 2
idouble: 1
ifloat: 2
-ildouble: 1
-ldouble: 1
+ildouble: 2
+ldouble: 2
+Test "j0 (0x1.d7ce3ap+107) == 2.775523647291230802651040996274861694514e-17":
+float: 1
+ifloat: 1
Test "j0 (10.0) == -0.245935764451348335197760862485328754":
double: 3
float: 1
@@ -998,8 +1150,8 @@ double: 1
float: 2
idouble: 1
ifloat: 2
-ildouble: 1
-ldouble: 1
+ildouble: 2
+ldouble: 2
Test "j0 (8.0) == 0.171650807137553906090869407851972001":
float: 1
ifloat: 1
@@ -1008,10 +1160,18 @@ ifloat: 1
Test "j1 (0.75) == 0.349243602174862192523281016426251335":
double: 1
idouble: 1
-Test "j1 (10.0) == 0.0434727461688614366697487680258592883":
-double: 1
+Test "j1 (0x1.3ffp+74) == 1.818984347516051243459364437186082741567e-12":
float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "j1 (0x1.ff00000000002p+840) == 1.846591691699331493194965158699937660696e-127":
+double: 1
idouble: 1
+Test "j1 (10.0) == 0.0434727461688614366697487680258592883":
+double: 2
+float: 1
+idouble: 2
ifloat: 1
ildouble: 1
ldouble: 1
@@ -1032,8 +1192,8 @@ double: 1
float: 2
idouble: 1
ifloat: 2
-ildouble: 1
-ldouble: 1
+ildouble: 2
+ldouble: 2
Test "jn (0, 10.0) == -0.245935764451348335197760862485328754":
double: 3
float: 1
@@ -1049,8 +1209,8 @@ double: 1
float: 2
idouble: 1
ifloat: 2
-ildouble: 1
-ldouble: 1
+ildouble: 2
+ldouble: 2
Test "jn (0, 8.0) == 0.171650807137553906090869407851972001":
float: 1
ifloat: 1
@@ -1058,9 +1218,9 @@ Test "jn (1, 0.75) == 0.349243602174862192523281016426251335":
double: 1
idouble: 1
Test "jn (1, 10.0) == 0.0434727461688614366697487680258592883":
-double: 1
+double: 2
float: 1
-idouble: 1
+idouble: 2
ifloat: 1
ildouble: 1
ldouble: 1
@@ -1110,6 +1270,11 @@ double: 2
idouble: 2
ildouble: 1
ldouble: 1
+Test "jn (2, 0x1.ffff62p+99) == -4.43860668048170034334926693188979974489e-16":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
Test "jn (2, 2.4048255576957729) == 0.43175480701968038399746111312430703":
double: 1
float: 1
@@ -1248,19 +1413,31 @@ idouble: 1
ildouble: 1
ldouble: 1
+# sin
+Test "sin (-0x1p65) == 0.047183876212354673805106149805700013943218":
+float: 1
+ifloat: 1
+Test "sin (0x1p65) == -0.047183876212354673805106149805700013943218":
+float: 1
+ifloat: 1
+
# sin_downward
Test "sin_downward (1) == 0.8414709848078965066525023216302989996226":
ildouble: 1
ldouble: 1
Test "sin_downward (10) == -0.5440211108893698134047476618513772816836":
double: 1
+float: 1
idouble: 1
+ifloat: 1
ildouble: 1
ldouble: 1
Test "sin_downward (2) == 0.9092974268256816953960198659117448427023":
double: 1
idouble: 1
Test "sin_downward (3) == 0.1411200080598672221007448028081102798469":
+float: 1
+ifloat: 1
ildouble: 1
ldouble: 1
Test "sin_downward (4) == -0.7568024953079282513726390945118290941359":
@@ -1295,6 +1472,9 @@ ildouble: 1
ldouble: 1
# sin_tonearest
+Test "sin_tonearest (1) == 0.8414709848078965066525023216302989996226":
+float: 1
+ifloat: 1
Test "sin_tonearest (10) == -0.5440211108893698134047476618513772816836":
ildouble: 1
ldouble: 1
@@ -1352,6 +1532,8 @@ ifloat: 1
Test "sin_upward (10) == -0.5440211108893698134047476618513772816836":
float: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
Test "sin_upward (2) == 0.9092974268256816953960198659117448427023":
float: 1
ifloat: 1
@@ -1362,12 +1544,18 @@ double: 1
float: 1
idouble: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
Test "sin_upward (4) == -0.7568024953079282513726390945118290941359":
float: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
Test "sin_upward (5) == -0.9589242746631384688931544061559939733525":
float: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
Test "sin_upward (6) == -0.2794154981989258728115554466118947596280":
ildouble: 1
ldouble: 1
@@ -1379,8 +1567,17 @@ ifloat: 1
Test "sin_upward (8) == 0.9893582466233817778081235982452886721164":
float: 1
ifloat: 1
+Test "sin_upward (9) == 0.4121184852417565697562725663524351793439":
+float: 1
+ifloat: 1
# sincos
+Test "sincos (-0x1p65, &sin_res, &cos_res) puts 0.047183876212354673805106149805700013943218 in sin_res":
+float: 1
+ifloat: 1
+Test "sincos (0x1p65, &sin_res, &cos_res) puts -0.047183876212354673805106149805700013943218 in sin_res":
+float: 1
+ifloat: 1
Test "sincos (M_PI_6l*2.0, &sin_res, &cos_res) puts 0.5 in cos_res":
double: 1
float: 1
@@ -1459,19 +1656,31 @@ idouble: 1
ldouble: 7
# tan
+Test "tan (0x1p16383) == 0.422722393732022337800504160054440141575":
+ildouble: 1
+ldouble: 1
+Test "tan (1e22) == -1.628778225606898878549375936939548513545":
+ildouble: 1
+ldouble: 1
Test "tan (pi/4) == 1":
double: 1
+float: 1
idouble: 1
+ifloat: 1
# tan_downward
Test "tan_downward (1) == 1.5574077246549022305069748074583601730873":
double: 1
-float: 1
+float: 2
idouble: 1
-ifloat: 1
+ifloat: 2
+ildouble: 1
+ldouble: 1
Test "tan_downward (10) == 0.6483608274590866712591249330098086768169":
float: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
Test "tan_downward (2) == -2.1850398632615189916433061023136825434320":
double: 1
float: 1
@@ -1512,6 +1721,8 @@ Test "tan_tonearest (1) == 1.5574077246549022305069748074583601730873":
ildouble: 1
ldouble: 1
Test "tan_tonearest (2) == -2.1850398632615189916433061023136825434320":
+float: 1
+ifloat: 1
ildouble: 1
ldouble: 1
Test "tan_tonearest (6) == -0.2910061913847491570536995888681755428312":
@@ -1530,9 +1741,13 @@ double: 1
float: 1
idouble: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
Test "tan_towardzero (10) == 0.6483608274590866712591249330098086768169":
float: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
Test "tan_towardzero (2) == -2.1850398632615189916433061023136825434320":
ildouble: 1
ldouble: 1
@@ -1572,6 +1787,8 @@ ldouble: 1
# tan_upward
Test "tan_upward (1) == 1.5574077246549022305069748074583601730873":
+float: 1
+ifloat: 1
ildouble: 1
ldouble: 1
Test "tan_upward (10) == 0.6483608274590866712591249330098086768169":
@@ -1595,8 +1812,8 @@ double: 1
float: 1
idouble: 1
ifloat: 1
-ildouble: 1
-ldouble: 1
+ildouble: 2
+ldouble: 2
Test "tan_upward (6) == -0.2910061913847491570536995888681755428312":
ildouble: 1
ldouble: 1
@@ -1645,6 +1862,14 @@ double: 1
float: 1
idouble: 1
ifloat: 1
+Test "y0 (0x1.3ffp+74) == 1.818984347516051243459467456433028748678e-12":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "y0 (0x1.ff00000000002p+840) == 1.846591691699331493194965158699937660696e-127":
+double: 1
+idouble: 1
Test "y0 (1.0) == 0.0882569642156769579829267660235151628":
double: 2
float: 1
@@ -1676,6 +1901,16 @@ ldouble: 1
Test "y1 (0.125) == -5.19993611253477499595928744876579921":
ildouble: 1
ldouble: 1
+Test "y1 (0x1.001000001p+593) == 3.927269966354206207832593635798954916263e-90":
+ildouble: 2
+ldouble: 2
+Test "y1 (0x1.27e204p+99) == -8.881610148467797208469612080785210013461e-16":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 1
+ldouble: 1
Test "y1 (1.0) == -0.781212821300288716547150000047964821":
double: 1
idouble: 1
@@ -1777,9 +2012,9 @@ float: 2
idouble: 1
ifloat: 2
Test "yn (10, 10.0) == -0.359814152183402722051986577343560609":
-double: 1
+double: 2
float: 3
-idouble: 1
+idouble: 2
ifloat: 3
Test "yn (10, 2.0) == -129184.542208039282635913145923304214":
double: 2
@@ -1927,10 +2162,18 @@ ildouble: 1
ldouble: 1
Function: Real part of "cexp":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
ildouble: 1
ldouble: 1
Function: Imaginary part of "cexp":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
ildouble: 1
ldouble: 1
@@ -1966,13 +2209,15 @@ ldouble: 1
Function: "cos_downward":
double: 1
-float: 1
+float: 2
idouble: 1
-ifloat: 1
+ifloat: 2
ildouble: 1
ldouble: 1
Function: "cos_tonearest":
+float: 1
+ifloat: 1
ildouble: 1
ldouble: 1
@@ -2013,20 +2258,20 @@ double: 1
ldouble: 1
Function: Real part of "cpow":
-double: 1
-float: 4
-idouble: 1
-ifloat: 4
-ildouble: 6
-ldouble: 6
+double: 2
+float: 5
+idouble: 2
+ifloat: 5
+ildouble: 5
+ldouble: 5
Function: Imaginary part of "cpow":
double: 2
float: 3
idouble: 2
ifloat: 3
-ildouble: 2
-ldouble: 2
+ildouble: 4
+ldouble: 4
Function: Real part of "csin":
float: 1
@@ -2054,6 +2299,10 @@ ifloat: 1
ildouble: 2
ldouble: 2
+Function: Imaginary part of "csqrt":
+ildouble: 1
+ldouble: 1
+
Function: Real part of "ctan":
double: 1
idouble: 1
@@ -2140,13 +2389,13 @@ double: 3
float: 2
idouble: 3
ifloat: 2
-ildouble: 1
-ldouble: 1
+ildouble: 2
+ldouble: 2
Function: "j1":
-double: 1
+double: 2
float: 1
-idouble: 1
+idouble: 2
ifloat: 1
ildouble: 1
ldouble: 1
@@ -2201,6 +2450,10 @@ ifloat: 1
ildouble: 1
ldouble: 1
+Function: "sin":
+float: 1
+ifloat: 1
+
Function: "sin_downward":
double: 1
float: 1
@@ -2210,6 +2463,8 @@ ildouble: 1
ldouble: 1
Function: "sin_tonearest":
+float: 1
+ifloat: 1
ildouble: 1
ldouble: 1
@@ -2265,17 +2520,23 @@ ldouble: 27
Function: "tan":
double: 1
+float: 1
idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
Function: "tan_downward":
double: 1
-float: 1
+float: 2
idouble: 1
-ifloat: 1
+ifloat: 2
ildouble: 1
ldouble: 1
Function: "tan_tonearest":
+float: 1
+ifloat: 1
ildouble: 1
ldouble: 1
@@ -2316,8 +2577,8 @@ double: 2
float: 2
idouble: 2
ifloat: 2
-ildouble: 1
-ldouble: 1
+ildouble: 2
+ldouble: 2
Function: "yn":
double: 2
diff --git a/libc/sysdeps/i386/fpu/math_private.h b/libc/sysdeps/i386/fpu/math_private.h
index 5253998a5..541a7f8d9 100644
--- a/libc/sysdeps/i386/fpu/math_private.h
+++ b/libc/sysdeps/i386/fpu/math_private.h
@@ -1,19 +1,6 @@
#ifndef _MATH_PRIVATE_H
-#define math_opt_barrier(x) \
-({ __typeof (x) __x; \
- __asm ("" : "=t" (__x) : "0" (x)); \
- __x; })
-#define math_force_eval(x) \
-do \
- { \
- __typeof (x) __x = (x); \
- if (sizeof (x) <= sizeof (double)) \
- __asm __volatile ("" : : "m" (__x)); \
- else \
- __asm __volatile ("" : : "f" (__x)); \
- } \
-while (0)
-
+#include "fenv_private.h"
#include_next <math_private.h>
+
#endif
diff --git a/libc/sysdeps/i386/fpu/mpa.c b/libc/sysdeps/i386/fpu/mpa.c
deleted file mode 100644
index 1cc893170..000000000
--- a/libc/sysdeps/i386/fpu/mpa.c
+++ /dev/null
@@ -1 +0,0 @@
-/* Not needed. */
diff --git a/libc/sysdeps/i386/fpu/mptan.c b/libc/sysdeps/i386/fpu/mptan.c
deleted file mode 100644
index 1cc893170..000000000
--- a/libc/sysdeps/i386/fpu/mptan.c
+++ /dev/null
@@ -1 +0,0 @@
-/* Not needed. */
diff --git a/libc/sysdeps/i386/fpu/s_cexp.S b/libc/sysdeps/i386/fpu/s_cexp.S
deleted file mode 100644
index e5fdb7d73..000000000
--- a/libc/sysdeps/i386/fpu/s_cexp.S
+++ /dev/null
@@ -1,253 +0,0 @@
-/* ix87 specific implementation of complex exponential function for double.
- Copyright (C) 1997, 2005, 2012 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <sysdep.h>
-
- .section .rodata
-
- .align ALIGNARG(4)
- ASM_TYPE_DIRECTIVE(huge_nan_null_null,@object)
-huge_nan_null_null:
- .byte 0, 0, 0, 0, 0, 0, 0xf0, 0x7f
- .byte 0, 0, 0, 0, 0, 0, 0xff, 0x7f
- .double 0.0
-zero: .double 0.0
-infinity:
- .byte 0, 0, 0, 0, 0, 0, 0xf0, 0x7f
- .byte 0, 0, 0, 0, 0, 0, 0xff, 0x7f
- .double 0.0
- .byte 0, 0, 0, 0, 0, 0, 0, 0x80
- ASM_SIZE_DIRECTIVE(huge_nan_null_null)
-
- ASM_TYPE_DIRECTIVE(twopi,@object)
-twopi:
- .byte 0x35, 0xc2, 0x68, 0x21, 0xa2, 0xda, 0xf, 0xc9, 0x1, 0x40
- .byte 0, 0, 0, 0, 0, 0
- ASM_SIZE_DIRECTIVE(twopi)
-
- ASM_TYPE_DIRECTIVE(l2e,@object)
-l2e:
- .byte 0xbc, 0xf0, 0x17, 0x5c, 0x29, 0x3b, 0xaa, 0xb8, 0xff, 0x3f
- .byte 0, 0, 0, 0, 0, 0
- ASM_SIZE_DIRECTIVE(l2e)
-
- ASM_TYPE_DIRECTIVE(one,@object)
-one: .double 1.0
- ASM_SIZE_DIRECTIVE(one)
-
-
-#ifdef PIC
-#define MO(op) op##@GOTOFF(%ecx)
-#define MOX(op,x,f) op##@GOTOFF(%ecx,x,f)
-#else
-#define MO(op) op
-#define MOX(op,x,f) op(,x,f)
-#endif
-
- .text
-ENTRY(__cexp)
- fldl 8(%esp) /* x */
- fxam
- fnstsw
- fldl 16(%esp) /* y : x */
-#ifdef PIC
- LOAD_PIC_REG (cx)
-#endif
- movb %ah, %dh
- andb $0x45, %ah
- cmpb $0x05, %ah
- je 1f /* Jump if real part is +-Inf */
- cmpb $0x01, %ah
- je 2f /* Jump if real part is NaN */
-
- fxam /* y : x */
- fnstsw
- /* If the imaginary part is not finite we return NaN+i NaN, as
- for the case when the real part is NaN. A test for +-Inf and
- NaN would be necessary. But since we know the stack register
- we applied `fxam' to is not empty we can simply use one test.
- Check your FPU manual for more information. */
- andb $0x01, %ah
- cmpb $0x01, %ah
- je 20f
-
- /* We have finite numbers in the real and imaginary part. Do
- the real work now. */
- fxch /* x : y */
- fldt MO(l2e) /* log2(e) : x : y */
- fmulp /* x * log2(e) : y */
- fld %st /* x * log2(e) : x * log2(e) : y */
- frndint /* int(x * log2(e)) : x * log2(e) : y */
- fsubr %st, %st(1) /* int(x * log2(e)) : frac(x * log2(e)) : y */
- fxch /* frac(x * log2(e)) : int(x * log2(e)) : y */
- f2xm1 /* 2^frac(x * log2(e))-1 : int(x * log2(e)) : y */
- faddl MO(one) /* 2^frac(x * log2(e)) : int(x * log2(e)) : y */
- fscale /* e^x : int(x * log2(e)) : y */
- fst %st(1) /* e^x : e^x : y */
- fxch %st(2) /* y : e^x : e^x */
- fsincos /* cos(y) : sin(y) : e^x : e^x */
- fnstsw
- testl $0x400, %eax
- jnz 7f
- fmulp %st, %st(3) /* sin(y) : e^x : e^x * cos(y) */
- fmulp %st, %st(1) /* e^x * sin(y) : e^x * cos(y) */
- movl 4(%esp), %eax /* Pointer to memory for result. */
- fstpl 8(%eax)
- fstpl (%eax)
- ret $4
-
- /* We have to reduce the argument to fsincos. */
- .align ALIGNARG(4)
-7: fldt MO(twopi) /* 2*pi : y : e^x : e^x */
- fxch /* y : 2*pi : e^x : e^x */
-8: fprem1 /* y%(2*pi) : 2*pi : e^x : e^x */
- fnstsw
- testl $0x400, %eax
- jnz 8b
- fstp %st(1) /* y%(2*pi) : e^x : e^x */
- fsincos /* cos(y) : sin(y) : e^x : e^x */
- fmulp %st, %st(3)
- fmulp %st, %st(1)
- movl 4(%esp), %eax /* Pointer to memory for result. */
- fstpl 8(%eax)
- fstpl (%eax)
- ret $4
-
- /* The real part is +-inf. We must make further differences. */
- .align ALIGNARG(4)
-1: fxam /* y : x */
- fnstsw
- movb %ah, %dl
- testb $0x01, %ah /* See above why 0x01 is usable here. */
- jne 3f
-
-
- /* The real part is +-Inf and the imaginary part is finite. */
- andl $0x245, %edx
- cmpb $0x40, %dl /* Imaginary part == 0? */
- je 4f /* Yes -> */
-
- fxch /* x : y */
- shrl $5, %edx
- fstp %st(0) /* y */ /* Drop the real part. */
- andl $16, %edx /* This puts the sign bit of the real part
- in bit 4. So we can use it to index a
- small array to select 0 or Inf. */
- fsincos /* cos(y) : sin(y) */
- fnstsw
- testl $0x0400, %eax
- jnz 5f
- fldl MOX(huge_nan_null_null,%edx,1)
- movl 4(%esp), %edx /* Pointer to memory for result. */
- fstl 8(%edx)
- fstpl (%edx)
- ftst
- fnstsw
- shll $23, %eax
- andl $0x80000000, %eax
- orl %eax, 4(%edx)
- fstp %st(0)
- ftst
- fnstsw
- shll $23, %eax
- andl $0x80000000, %eax
- orl %eax, 12(%edx)
- fstp %st(0)
- ret $4
- /* We must reduce the argument to fsincos. */
- .align ALIGNARG(4)
-5: fldt MO(twopi)
- fxch
-6: fprem1
- fnstsw
- testl $0x400, %eax
- jnz 6b
- fstp %st(1)
- fsincos
- fldl MOX(huge_nan_null_null,%edx,1)
- movl 4(%esp), %edx /* Pointer to memory for result. */
- fstl 8(%edx)
- fstpl (%edx)
- ftst
- fnstsw
- shll $23, %eax
- andl $0x80000000, %eax
- orl %eax, 4(%edx)
- fstp %st(0)
- ftst
- fnstsw
- shll $23, %eax
- andl $0x80000000, %eax
- orl %eax, 12(%edx)
- fstp %st(0)
- ret $4
-
- /* The real part is +-Inf and the imaginary part is +-0. So return
- +-Inf+-0i. */
- .align ALIGNARG(4)
-4: movl 4(%esp), %eax /* Pointer to memory for result. */
- fstpl 8(%eax)
- shrl $5, %edx
- fstp %st(0)
- andl $16, %edx
- fldl MOX(huge_nan_null_null,%edx,1)
- fstpl (%eax)
- ret $4
-
- /* The real part is +-Inf, the imaginary is also is not finite. */
- .align ALIGNARG(4)
-3: fstp %st(0)
- fstp %st(0) /* <empty> */
- andb $0x45, %ah
- andb $0x47, %dh
- xorb %dh, %ah
- jnz 30f
- fldl MO(infinity) /* Raise invalid exception. */
- fmull MO(zero)
- fstp %st(0)
-30: movl %edx, %eax
- shrl $5, %edx
- shll $4, %eax
- andl $16, %edx
- andl $32, %eax
- orl %eax, %edx
- movl 4(%esp), %eax /* Pointer to memory for result. */
-
- fldl MOX(huge_nan_null_null,%edx,1)
- fldl MOX(huge_nan_null_null+8,%edx,1)
- fxch
- fstpl (%eax)
- fstpl 8(%eax)
- ret $4
-
- /* The real part is NaN. */
- .align ALIGNARG(4)
-20: fldl MO(infinity) /* Raise invalid exception. */
- fmull MO(zero)
- fstp %st(0)
-2: fstp %st(0)
- fstp %st(0)
- movl 4(%esp), %eax /* Pointer to memory for result. */
- fldl MO(huge_nan_null_null+8)
- fstl (%eax)
- fstpl 8(%eax)
- ret $4
-
-END(__cexp)
-weak_alias (__cexp, cexp)
diff --git a/libc/sysdeps/i386/fpu/s_cexpf.S b/libc/sysdeps/i386/fpu/s_cexpf.S
deleted file mode 100644
index 6ed66e6d0..000000000
--- a/libc/sysdeps/i386/fpu/s_cexpf.S
+++ /dev/null
@@ -1,257 +0,0 @@
-/* ix87 specific implementation of complex exponential function for double.
- Copyright (C) 1997, 2005, 2012 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <sysdep.h>
-
- .section .rodata
-
- .align ALIGNARG(4)
- ASM_TYPE_DIRECTIVE(huge_nan_null_null,@object)
-huge_nan_null_null:
- .byte 0, 0, 0x80, 0x7f
- .byte 0, 0, 0xc0, 0x7f
- .float 0.0
-zero: .float 0.0
-infinity:
- .byte 0, 0, 0x80, 0x7f
- .byte 0, 0, 0xc0, 0x7f
- .float 0.0
- .byte 0, 0, 0, 0x80
- ASM_SIZE_DIRECTIVE(huge_nan_null_null)
-
- ASM_TYPE_DIRECTIVE(twopi,@object)
-twopi:
- .byte 0x35, 0xc2, 0x68, 0x21, 0xa2, 0xda, 0xf, 0xc9, 0x1, 0x40
- .byte 0, 0, 0, 0, 0, 0
- ASM_SIZE_DIRECTIVE(twopi)
-
- ASM_TYPE_DIRECTIVE(l2e,@object)
-l2e:
- .byte 0xbc, 0xf0, 0x17, 0x5c, 0x29, 0x3b, 0xaa, 0xb8, 0xff, 0x3f
- .byte 0, 0, 0, 0, 0, 0
- ASM_SIZE_DIRECTIVE(l2e)
-
- ASM_TYPE_DIRECTIVE(one,@object)
-one: .double 1.0
- ASM_SIZE_DIRECTIVE(one)
-
-
-#ifdef PIC
-#define MO(op) op##@GOTOFF(%ecx)
-#define MOX(op,x,f) op##@GOTOFF(%ecx,x,f)
-#else
-#define MO(op) op
-#define MOX(op,x,f) op(,x,f)
-#endif
-
- .text
-ENTRY(__cexpf)
- flds 4(%esp) /* x */
- fxam
- fnstsw
- flds 8(%esp) /* y : x */
-#ifdef PIC
- LOAD_PIC_REG (cx)
-#endif
- movb %ah, %dh
- andb $0x45, %ah
- cmpb $0x05, %ah
- je 1f /* Jump if real part is +-Inf */
- cmpb $0x01, %ah
- je 2f /* Jump if real part is NaN */
-
- fxam /* y : x */
- fnstsw
- /* If the imaginary part is not finite we return NaN+i NaN, as
- for the case when the real part is NaN. A test for +-Inf and
- NaN would be necessary. But since we know the stack register
- we applied `fxam' to is not empty we can simply use one test.
- Check your FPU manual for more information. */
- andb $0x01, %ah
- cmpb $0x01, %ah
- je 20f
-
- /* We have finite numbers in the real and imaginary part. Do
- the real work now. */
- fxch /* x : y */
- fldt MO(l2e) /* log2(e) : x : y */
- fmulp /* x * log2(e) : y */
- fld %st /* x * log2(e) : x * log2(e) : y */
- frndint /* int(x * log2(e)) : x * log2(e) : y */
- fsubr %st, %st(1) /* int(x * log2(e)) : frac(x * log2(e)) : y */
- fxch /* frac(x * log2(e)) : int(x * log2(e)) : y */
- f2xm1 /* 2^frac(x * log2(e))-1 : int(x * log2(e)) : y */
- faddl MO(one) /* 2^frac(x * log2(e)) : int(x * log2(e)) : y */
- fscale /* e^x : int(x * log2(e)) : y */
- fst %st(1) /* e^x : e^x : y */
- fxch %st(2) /* y : e^x : e^x */
- fsincos /* cos(y) : sin(y) : e^x : e^x */
- fnstsw
- testl $0x400, %eax
- jnz 7f
- fmulp %st, %st(3) /* sin(y) : e^x : e^x * cos(y) */
- fmulp %st, %st(1) /* e^x * sin(y) : e^x * cos(y) */
- subl $8, %esp
- cfi_adjust_cfa_offset (8)
- fstps 4(%esp)
- fstps (%esp)
- popl %eax
- cfi_adjust_cfa_offset (-4)
- popl %edx
- cfi_adjust_cfa_offset (-4)
- ret
-
- /* We have to reduce the argument to fsincos. */
- .align ALIGNARG(4)
-7: fldt MO(twopi) /* 2*pi : y : e^x : e^x */
- fxch /* y : 2*pi : e^x : e^x */
-8: fprem1 /* y%(2*pi) : 2*pi : e^x : e^x */
- fnstsw
- testl $0x400, %eax
- jnz 8b
- fstp %st(1) /* y%(2*pi) : e^x : e^x */
- fsincos /* cos(y) : sin(y) : e^x : e^x */
- fmulp %st, %st(3)
- fmulp %st, %st(1)
- subl $8, %esp
- cfi_adjust_cfa_offset (8)
- fstps 4(%esp)
- fstps (%esp)
- popl %eax
- cfi_adjust_cfa_offset (-4)
- popl %edx
- cfi_adjust_cfa_offset (-4)
- ret
-
- /* The real part is +-inf. We must make further differences. */
- .align ALIGNARG(4)
-1: fxam /* y : x */
- fnstsw
- movb %ah, %dl
- testb $0x01, %ah /* See above why 0x01 is usable here. */
- jne 3f
-
-
- /* The real part is +-Inf and the imaginary part is finite. */
- andl $0x245, %edx
- cmpb $0x40, %dl /* Imaginary part == 0? */
- je 4f /* Yes -> */
-
- fxch /* x : y */
- shrl $6, %edx
- fstp %st(0) /* y */ /* Drop the real part. */
- andl $8, %edx /* This puts the sign bit of the real part
- in bit 3. So we can use it to index a
- small array to select 0 or Inf. */
- fsincos /* cos(y) : sin(y) */
- fnstsw
- testl $0x0400, %eax
- jnz 5f
- fxch
- ftst
- fnstsw
- fstp %st(0)
- shll $23, %eax
- andl $0x80000000, %eax
- orl MOX(huge_nan_null_null,%edx,1), %eax
- movl MOX(huge_nan_null_null,%edx,1), %ecx
- movl %eax, %edx
- ftst
- fnstsw
- fstp %st(0)
- shll $23, %eax
- andl $0x80000000, %eax
- orl %ecx, %eax
- ret
- /* We must reduce the argument to fsincos. */
- .align ALIGNARG(4)
-5: fldt MO(twopi)
- fxch
-6: fprem1
- fnstsw
- testl $0x400, %eax
- jnz 6b
- fstp %st(1)
- fsincos
- fxch
- ftst
- fnstsw
- fstp %st(0)
- shll $23, %eax
- andl $0x80000000, %eax
- orl MOX(huge_nan_null_null,%edx,1), %eax
- movl MOX(huge_nan_null_null,%edx,1), %ecx
- movl %eax, %edx
- ftst
- fnstsw
- fstp %st(0)
- shll $23, %eax
- andl $0x80000000, %eax
- orl %ecx, %eax
- ret
-
- /* The real part is +-Inf and the imaginary part is +-0. So return
- +-Inf+-0i. */
- .align ALIGNARG(4)
-4: subl $4, %esp
- cfi_adjust_cfa_offset (4)
- fstps (%esp)
- shrl $6, %edx
- fstp %st(0)
- andl $8, %edx
- movl MOX(huge_nan_null_null,%edx,1), %eax
- popl %edx
- cfi_adjust_cfa_offset (-4)
- ret
-
- /* The real part is +-Inf, the imaginary is also is not finite. */
- .align ALIGNARG(4)
-3: fstp %st(0)
- fstp %st(0) /* <empty> */
- andb $0x45, %ah
- andb $0x47, %dh
- xorb %dh, %ah
- jnz 30f
- flds MO(infinity) /* Raise invalid exception. */
- fmuls MO(zero)
- fstp %st(0)
-30: movl %edx, %eax
- shrl $6, %edx
- shll $3, %eax
- andl $8, %edx
- andl $16, %eax
- orl %eax, %edx
-
- movl MOX(huge_nan_null_null,%edx,1), %eax
- movl MOX(huge_nan_null_null+4,%edx,1), %edx
- ret
-
- /* The real part is NaN. */
- .align ALIGNARG(4)
-20: flds MO(infinity) /* Raise invalid exception. */
- fmuls MO(zero)
- fstp %st(0)
-2: fstp %st(0)
- fstp %st(0)
- movl MO(huge_nan_null_null+4), %eax
- movl %eax, %edx
- ret
-
-END(__cexpf)
-weak_alias (__cexpf, cexpf)
diff --git a/libc/sysdeps/i386/fpu/s_cexpl.S b/libc/sysdeps/i386/fpu/s_cexpl.S
deleted file mode 100644
index ab02a172a..000000000
--- a/libc/sysdeps/i386/fpu/s_cexpl.S
+++ /dev/null
@@ -1,256 +0,0 @@
-/* ix87 specific implementation of complex exponential function for double.
- Copyright (C) 1997, 2005, 2012 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <sysdep.h>
-
- .section .rodata
-
- .align ALIGNARG(4)
- ASM_TYPE_DIRECTIVE(huge_nan_null_null,@object)
-huge_nan_null_null:
- .byte 0, 0, 0, 0, 0, 0, 0xf0, 0x7f
- .byte 0, 0, 0, 0, 0, 0, 0xff, 0x7f
- .double 0.0
-zero: .double 0.0
-infinity:
- .byte 0, 0, 0, 0, 0, 0, 0xf0, 0x7f
- .byte 0, 0, 0, 0, 0, 0, 0xff, 0x7f
- .double 0.0
- .byte 0, 0, 0, 0, 0, 0, 0, 0x80
- ASM_SIZE_DIRECTIVE(huge_nan_null_null)
-
- ASM_TYPE_DIRECTIVE(twopi,@object)
-twopi:
- .byte 0x35, 0xc2, 0x68, 0x21, 0xa2, 0xda, 0xf, 0xc9, 0x1, 0x40
- .byte 0, 0, 0, 0, 0, 0
- ASM_SIZE_DIRECTIVE(twopi)
-
- ASM_TYPE_DIRECTIVE(l2e,@object)
-l2e:
- .byte 0xbc, 0xf0, 0x17, 0x5c, 0x29, 0x3b, 0xaa, 0xb8, 0xff, 0x3f
- .byte 0, 0, 0, 0, 0, 0
- ASM_SIZE_DIRECTIVE(l2e)
-
- ASM_TYPE_DIRECTIVE(one,@object)
-one: .double 1.0
- ASM_SIZE_DIRECTIVE(one)
-
-
-#ifdef PIC
-#define MO(op) op##@GOTOFF(%ecx)
-#define MOX(op,x,f) op##@GOTOFF(%ecx,x,f)
-#else
-#define MO(op) op
-#define MOX(op,x,f) op(,x,f)
-#endif
-
- .text
-ENTRY(__cexpl)
- fldt 8(%esp) /* x */
- fxam
- fnstsw
- fldt 20(%esp) /* y : x */
-#ifdef PIC
- LOAD_PIC_REG (cx)
-#endif
- movb %ah, %dh
- andb $0x45, %ah
- cmpb $0x05, %ah
- je 1f /* Jump if real part is +-Inf */
- cmpb $0x01, %ah
- je 2f /* Jump if real part is NaN */
-
- fxam /* y : x */
- fnstsw
- /* If the imaginary part is not finite we return NaN+i NaN, as
- for the case when the real part is NaN. A test for +-Inf and
- NaN would be necessary. But since we know the stack register
- we applied `fxam' to is not empty we can simply use one test.
- Check your FPU manual for more information. */
- andb $0x01, %ah
- cmpb $0x01, %ah
- je 20f
-
- /* We have finite numbers in the real and imaginary part. Do
- the real work now. */
- fxch /* x : y */
- fldt MO(l2e) /* log2(e) : x : y */
- fmulp /* x * log2(e) : y */
- fld %st /* x * log2(e) : x * log2(e) : y */
- frndint /* int(x * log2(e)) : x * log2(e) : y */
- fsubr %st, %st(1) /* int(x * log2(e)) : frac(x * log2(e)) : y */
- fxch /* frac(x * log2(e)) : int(x * log2(e)) : y */
- f2xm1 /* 2^frac(x * log2(e))-1 : int(x * log2(e)) : y */
- faddl MO(one) /* 2^frac(x * log2(e)) : int(x * log2(e)) : y */
- fscale /* e^x : int(x * log2(e)) : y */
- fst %st(1) /* e^x : e^x : y */
- fxch %st(2) /* y : e^x : e^x */
- fsincos /* cos(y) : sin(y) : e^x : e^x */
- fnstsw
- testl $0x400, %eax
- jnz 7f
- fmulp %st, %st(3) /* sin(y) : e^x : e^x * cos(y) */
- fmulp %st, %st(1) /* e^x * sin(y) : e^x * cos(y) */
- movl 4(%esp), %eax /* Pointer to memory for result. */
- fstpt 12(%eax)
- fstpt (%eax)
- ret $4
-
- /* We have to reduce the argument to fsincos. */
- .align ALIGNARG(4)
-7: fldt MO(twopi) /* 2*pi : y : e^x : e^x */
- fxch /* y : 2*pi : e^x : e^x */
-8: fprem1 /* y%(2*pi) : 2*pi : e^x : e^x */
- fnstsw
- testl $0x400, %eax
- jnz 8b
- fstp %st(1) /* y%(2*pi) : e^x : e^x */
- fsincos /* cos(y) : sin(y) : e^x : e^x */
- fmulp %st, %st(3)
- fmulp %st, %st(1)
- movl 4(%esp), %eax /* Pointer to memory for result. */
- fstpt 12(%eax)
- fstpt (%eax)
- ret $4
-
- /* The real part is +-inf. We must make further differences. */
- .align ALIGNARG(4)
-1: fxam /* y : x */
- fnstsw
- movb %ah, %dl
- testb $0x01, %ah /* See above why 0x01 is usable here. */
- jne 3f
-
-
- /* The real part is +-Inf and the imaginary part is finite. */
- andl $0x245, %edx
- cmpb $0x40, %dl /* Imaginary part == 0? */
- je 4f /* Yes -> */
-
- fxch /* x : y */
- shrl $5, %edx
- fstp %st(0) /* y */ /* Drop the real part. */
- andl $16, %edx /* This puts the sign bit of the real part
- in bit 4. So we can use it to index a
- small array to select 0 or Inf. */
- fsincos /* cos(y) : sin(y) */
- fnstsw
- testl $0x0400, %eax
- jnz 5f
- fldl MOX(huge_nan_null_null,%edx,1)
- movl 4(%esp), %edx /* Pointer to memory for result. */
- fld %st
- fstpt 12(%edx)
- fstpt (%edx)
- ftst
- fnstsw
- shll $7, %eax
- andl $0x8000, %eax
- orl %eax, 8(%edx)
- fstp %st(0)
- ftst
- fnstsw
- shll $7, %eax
- andl $0x8000, %eax
- orl %eax, 20(%edx)
- fstp %st(0)
- ret $4
- /* We must reduce the argument to fsincos. */
- .align ALIGNARG(4)
-5: fldt MO(twopi)
- fxch
-6: fprem1
- fnstsw
- testl $0x400, %eax
- jnz 6b
- fstp %st(1)
- fsincos
- fldl MOX(huge_nan_null_null,%edx,1)
- movl 4(%esp), %edx /* Pointer to memory for result. */
- fld %st
- fstpt 12(%edx)
- fstpt (%edx)
- ftst
- fnstsw
- shll $7, %eax
- andl $0x8000, %eax
- orl %eax, 8(%edx)
- fstp %st(0)
- ftst
- fnstsw
- shll $7, %eax
- andl $0x8000, %eax
- orl %eax, 20(%edx)
- fstp %st(0)
- ret $4
-
- /* The real part is +-Inf and the imaginary part is +-0. So return
- +-Inf+-0i. */
- .align ALIGNARG(4)
-4: movl 4(%esp), %eax /* Pointer to memory for result. */
- fstpt 12(%eax)
- shrl $5, %edx
- fstp %st(0)
- andl $16, %edx
- fldl MOX(huge_nan_null_null,%edx,1)
- fstpt (%eax)
- ret $4
-
- /* The real part is +-Inf, the imaginary is also is not finite. */
- .align ALIGNARG(4)
-3: fstp %st(0)
- fstp %st(0) /* <empty> */
- andb $0x45, %ah
- andb $0x47, %dh
- xorb %dh, %ah
- jnz 30f
- fldl MO(infinity) /* Raise invalid exception. */
- fmull MO(zero)
- fstp %st(0)
-30: movl %edx, %eax
- shrl $5, %edx
- shll $4, %eax
- andl $16, %edx
- andl $32, %eax
- orl %eax, %edx
- movl 4(%esp), %eax /* Pointer to memory for result. */
-
- fldl MOX(huge_nan_null_null,%edx,1)
- fldl MOX(huge_nan_null_null+8,%edx,1)
- fxch
- fstpt (%eax)
- fstpt 12(%eax)
- ret $4
-
- /* The real part is NaN. */
- .align ALIGNARG(4)
-20: fldl MO(infinity) /* Raise invalid exception. */
- fmull MO(zero)
- fstp %st(0)
-2: fstp %st(0)
- fstp %st(0)
- movl 4(%esp), %eax /* Pointer to memory for result. */
- fldl MO(huge_nan_null_null+8)
- fld %st(0)
- fstpt (%eax)
- fstpt 12(%eax)
- ret $4
-
-END(__cexpl)
-weak_alias (__cexpl, cexpl)
diff --git a/libc/sysdeps/i386/fpu/s_cos.S b/libc/sysdeps/i386/fpu/s_cos.S
deleted file mode 100644
index d341d008c..000000000
--- a/libc/sysdeps/i386/fpu/s_cos.S
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Written by J.T. Conklin <jtc@netbsd.org>.
- * Fixed errno handling by Ulrich Drepper <drepper@redhat.com>.
- * Public domain.
- */
-
-#define __need_Emath
-#include <bits/errno.h>
-#include <machine/asm.h>
-
-RCSID("$NetBSD: s_cos.S,v 1.5 1995/05/08 23:54:00 jtc Exp $")
-
-ENTRY(__cos)
- fldl 4(%esp)
- fxam
- fstsw %ax
- movb $0x45, %dh
- andb %ah, %dh
- cmpb $0x05, %dh
- je 3f
-4: fcos
- fnstsw %ax
- testl $0x400,%eax
- jnz 1f
- ret
- .align ALIGNARG(4)
-1: fldpi
- fadd %st(0)
- fxch %st(1)
-2: fprem1
- fnstsw %ax
- testl $0x400,%eax
- jnz 2b
- fstp %st(1)
- fcos
- ret
-3:
-#ifdef PIC
- pushl %ebx
- cfi_adjust_cfa_offset (4)
- cfi_rel_offset (ebx, 0)
- LOAD_PIC_REG (bx)
- call __errno_location@PLT
- movl $EDOM, (%eax)
- popl %ebx
- cfi_adjust_cfa_offset (-4)
- cfi_restore (ebx)
-#else
- call __errno_location@PLT
- movl $EDOM, (%eax)
-#endif
- jmp 4b
-END (__cos)
-weak_alias (__cos, cos)
diff --git a/libc/sysdeps/i386/fpu/s_cosf.S b/libc/sysdeps/i386/fpu/s_cosf.S
deleted file mode 100644
index 578967ad3..000000000
--- a/libc/sysdeps/i386/fpu/s_cosf.S
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Written by J.T. Conklin <jtc@netbsd.org>.
- * Fixed errno handling by Ulrich Drepper <drepper@redhat.com>.
- * Public domain.
- */
-
-#define __need_Emath
-#include <bits/errno.h>
-#include <machine/asm.h>
-
-RCSID("$NetBSD: s_cosf.S,v 1.3 1995/05/08 23:55:16 jtc Exp $")
-
-ENTRY(__cosf)
- flds 4(%esp)
- fxam
- fstsw %ax
- movb $0x45, %dh
- andb %ah, %dh
- cmpb $0x05, %dh
- je 3f
-4: fcos
- fnstsw %ax
- testl $0x400,%eax
- jnz 1f
- ret
- .align ALIGNARG(4)
-1: fldpi
- fadd %st(0)
- fxch %st(1)
-2: fprem1
- fnstsw %ax
- testl $0x400,%eax
- jnz 2b
- fstp %st(1)
- fcos
- ret
-3:
-#ifdef PIC
- pushl %ebx
- cfi_adjust_cfa_offset (4)
- cfi_rel_offset (ebx, 0)
- LOAD_PIC_REG (bx)
- call __errno_location@PLT
- movl $EDOM, (%eax)
- popl %ebx
- cfi_adjust_cfa_offset (-4)
- cfi_restore (ebx)
-#else
- call __errno_location@PLT
- movl $EDOM, (%eax)
-#endif
- jmp 4b
-END (__cosf)
-weak_alias (__cosf, cosf)
diff --git a/libc/sysdeps/i386/fpu/s_cosl.S b/libc/sysdeps/i386/fpu/s_cosl.S
deleted file mode 100644
index 27dd74f21..000000000
--- a/libc/sysdeps/i386/fpu/s_cosl.S
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Written by J.T. Conklin <jtc@netbsd.org>.
- * Public domain.
- *
- * Adapted for `long double' by Ulrich Drepper <drepper@cygnus.com>.
- * Fixed errno handling by Ulrich Drepper <drepper@redhat.com>.
- */
-
-#define __need_Emath
-#include <bits/errno.h>
-#include <machine/asm.h>
-
-ENTRY(__cosl)
- fldt 4(%esp)
- fxam
- fstsw %ax
- movb $0x45, %dh
- andb %ah, %dh
- cmpb $0x05, %dh
- je 3f
-4: fcos
- fnstsw %ax
- testl $0x400,%eax
- jnz 1f
- ret
- .align ALIGNARG(4)
-1: fldpi
- fadd %st(0)
- fxch %st(1)
-2: fprem1
- fnstsw %ax
- testl $0x400,%eax
- jnz 2b
- fstp %st(1)
- fcos
- ret
-3:
-#ifdef PIC
- pushl %ebx
- cfi_adjust_cfa_offset (4)
- cfi_rel_offset (ebx, 0)
- LOAD_PIC_REG (bx)
- call __errno_location@PLT
- movl $EDOM, (%eax)
- popl %ebx
- cfi_adjust_cfa_offset (-4)
- cfi_restore (ebx)
-#else
- call __errno_location@PLT
- movl $EDOM, (%eax)
-#endif
- jmp 4b
-END (__cosl)
-weak_alias (__cosl, cosl)
diff --git a/libc/sysdeps/i386/fpu/s_sin.S b/libc/sysdeps/i386/fpu/s_sin.S
deleted file mode 100644
index 6b913992d..000000000
--- a/libc/sysdeps/i386/fpu/s_sin.S
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Written by J.T. Conklin <jtc@netbsd.org>.
- * Fixed errno handling by Ulrich Drepper <drepper@redhat.com>.
- * Public domain.
- */
-
-#define __need_Emath
-#include <bits/errno.h>
-#include <machine/asm.h>
-
-RCSID("$NetBSD: s_sin.S,v 1.5 1995/05/09 00:25:54 jtc Exp $")
-
-ENTRY(__sin)
- fldl 4(%esp)
- fxam
- fstsw %ax
- movb $0x45, %dh
- andb %ah, %dh
- cmpb $0x05, %dh
- je 3f
-4: fsin
- fnstsw %ax
- testl $0x400,%eax
- jnz 1f
- ret
- .align ALIGNARG(4)
-1: fldpi
- fadd %st(0)
- fxch %st(1)
-2: fprem1
- fnstsw %ax
- testl $0x400,%eax
- jnz 2b
- fstp %st(1)
- fsin
- ret
-3:
-#ifdef PIC
- pushl %ebx
- cfi_adjust_cfa_offset (4)
- cfi_rel_offset (ebx, 0)
- LOAD_PIC_REG (bx)
- call __errno_location@PLT
- movl $EDOM, (%eax)
- popl %ebx
- cfi_adjust_cfa_offset (-4)
- cfi_restore (ebx)
-#else
- call __errno_location@PLT
- movl $EDOM, (%eax)
-#endif
- jmp 4b
-END (__sin)
-weak_alias (__sin, sin)
diff --git a/libc/sysdeps/i386/fpu/s_sincos.S b/libc/sysdeps/i386/fpu/s_sincos.S
deleted file mode 100644
index 86526c972..000000000
--- a/libc/sysdeps/i386/fpu/s_sincos.S
+++ /dev/null
@@ -1,64 +0,0 @@
-/* Compute sine and cosine of argument.
- Copyright (C) 1997, 2000 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <machine/asm.h>
-#include "bp-sym.h"
-#include "bp-asm.h"
-
-#define PARMS LINKAGE /* no space for saved regs */
-#define ANGLE PARMS
-#define SINP ANGLE+8
-#define COSP SINP+PTR_SIZE
-
- .text
-ENTRY (BP_SYM (__sincos))
- ENTER
-
- fldl ANGLE(%esp)
- fsincos
- movl SINP(%esp), %ecx
- CHECK_BOUNDS_BOTH_WIDE (%ecx, SINP(%esp), $8)
- movl COSP(%esp), %edx
- CHECK_BOUNDS_BOTH_WIDE (%edx, COSP(%esp), $8)
- fnstsw %ax
- testl $0x400,%eax
- jnz 1f
- fstpl (%edx)
- fstpl (%ecx)
-
- LEAVE
- ret
-
- .align ALIGNARG(4)
-1: fldpi
- fadd %st(0)
- fxch %st(1)
-2: fprem1
- fnstsw %ax
- testl $0x400,%eax
- jnz 2b
- fstp %st(1)
- fsincos
- fstpl (%edx)
- fstpl (%ecx)
-
- LEAVE
- ret
-END (BP_SYM (__sincos))
-weak_alias (BP_SYM (__sincos), BP_SYM (sincos))
diff --git a/libc/sysdeps/i386/fpu/s_sincosf.S b/libc/sysdeps/i386/fpu/s_sincosf.S
deleted file mode 100644
index 677c7c41f..000000000
--- a/libc/sysdeps/i386/fpu/s_sincosf.S
+++ /dev/null
@@ -1,64 +0,0 @@
-/* Compute sine and cosine of argument.
- Copyright (C) 1997, 2000 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <machine/asm.h>
-#include "bp-sym.h"
-#include "bp-asm.h"
-
-#define PARMS LINKAGE /* no space for saved regs */
-#define ANGLE PARMS
-#define SINP ANGLE+4
-#define COSP SINP+PTR_SIZE
-
- .text
-ENTRY (BP_SYM (__sincosf))
- ENTER
-
- flds ANGLE(%esp)
- fsincos
- movl SINP(%esp), %ecx
- CHECK_BOUNDS_BOTH_WIDE (%ecx, SINP(%esp), $4)
- movl COSP(%esp), %edx
- CHECK_BOUNDS_BOTH_WIDE (%edx, COSP(%esp), $4)
- fnstsw %ax
- testl $0x400,%eax
- jnz 1f
- fstps (%edx)
- fstps (%ecx)
-
- LEAVE
- ret
-
- .align ALIGNARG(4)
-1: fldpi
- fadd %st(0)
- fxch %st(1)
-2: fprem1
- fnstsw %ax
- testl $0x400,%eax
- jnz 2b
- fstp %st(1)
- fsincos
- fstps (%edx)
- fstps (%ecx)
-
- LEAVE
- ret
-END (BP_SYM (__sincosf))
-weak_alias (BP_SYM (__sincosf), BP_SYM (sincosf))
diff --git a/libc/sysdeps/i386/fpu/s_sincosl.S b/libc/sysdeps/i386/fpu/s_sincosl.S
deleted file mode 100644
index 42a96257a..000000000
--- a/libc/sysdeps/i386/fpu/s_sincosl.S
+++ /dev/null
@@ -1,64 +0,0 @@
-/* Compute sine and cosine of argument.
- Copyright (C) 1997, 2000 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <machine/asm.h>
-#include "bp-sym.h"
-#include "bp-asm.h"
-
-#define PARMS LINKAGE /* no space for saved regs */
-#define ANGLE PARMS
-#define SINP ANGLE+12
-#define COSP SINP+PTR_SIZE
-
- .text
-ENTRY (BP_SYM (__sincosl))
- ENTER
-
- fldt ANGLE(%esp)
- fsincos
- movl SINP(%esp), %ecx
- CHECK_BOUNDS_BOTH_WIDE (%ecx, SINP(%esp), $12)
- movl COSP(%esp), %edx
- CHECK_BOUNDS_BOTH_WIDE (%edx, COSP(%esp), $12)
- fnstsw %ax
- testl $0x400,%eax
- jnz 1f
- fstpt (%edx)
- fstpt (%ecx)
-
- LEAVE
- ret
-
- .align ALIGNARG(4)
-1: fldpi
- fadd %st(0)
- fxch %st(1)
-2: fprem1
- fnstsw %ax
- testl $0x400,%eax
- jnz 2b
- fstp %st(1)
- fsincos
- fstpt (%edx)
- fstpt (%ecx)
-
- LEAVE
- ret
-END (BP_SYM (__sincosl))
-weak_alias (BP_SYM (__sincosl), BP_SYM (sincosl))
diff --git a/libc/sysdeps/i386/fpu/s_sinf.S b/libc/sysdeps/i386/fpu/s_sinf.S
deleted file mode 100644
index 67621f70f..000000000
--- a/libc/sysdeps/i386/fpu/s_sinf.S
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Written by J.T. Conklin <jtc@netbsd.org>.
- * Fixed errno handling by Ulrich Drepper <drepper@redhat.com>.
- * Public domain.
- */
-
-#define __need_Emath
-#include <bits/errno.h>
-#include <machine/asm.h>
-
-RCSID("$NetBSD: s_sinf.S,v 1.3 1995/05/09 00:27:53 jtc Exp $")
-
-ENTRY(__sinf)
- flds 4(%esp)
- fxam
- fstsw %ax
- movb $0x45, %dh
- andb %ah, %dh
- cmpb $0x05, %dh
- je 3f
-4: fsin
- fnstsw %ax
- testl $0x400,%eax
- jnz 1f
- ret
- .align ALIGNARG(4)
-1: fldpi
- fadd %st(0)
- fxch %st(1)
-2: fprem1
- fnstsw %ax
- testl $0x400,%eax
- jnz 2b
- fstp %st(1)
- fsin
- ret
-3:
-#ifdef PIC
- pushl %ebx
- cfi_adjust_cfa_offset (4)
- cfi_rel_offset (ebx, 0)
- LOAD_PIC_REG (bx)
- call __errno_location@PLT
- movl $EDOM, (%eax)
- popl %ebx
- cfi_adjust_cfa_offset (-4)
- cfi_restore (ebx)
-#else
- call __errno_location@PLT
- movl $EDOM, (%eax)
-#endif
- jmp 4b
-END (__sinf)
-weak_alias (__sinf, sinf)
diff --git a/libc/sysdeps/i386/fpu/s_sinl.S b/libc/sysdeps/i386/fpu/s_sinl.S
deleted file mode 100644
index 68c4f9966..000000000
--- a/libc/sysdeps/i386/fpu/s_sinl.S
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Written by J.T. Conklin <jtc@netbsd.org>.
- * Public domain.
- *
- * Adapted for `long double' by Ulrich Drepper <drepper@cygnus.com>.
- * Fixed errno handling by Ulrich Drepper <drepper@redhat.com>.
- */
-
-#define __need_Emath
-#include <bits/errno.h>
-#include <machine/asm.h>
-
-ENTRY(__sinl)
- fldt 4(%esp)
- fxam
- fstsw %ax
- movb $0x45, %dh
- andb %ah, %dh
- cmpb $0x05, %dh
- je 3f
-4: fsin
- fnstsw %ax
- testl $0x400,%eax
- jnz 1f
- ret
- .align ALIGNARG(4)
-1: fldpi
- fadd %st(0)
- fxch %st(1)
-2: fprem1
- fnstsw %ax
- testl $0x400,%eax
- jnz 2b
- fstp %st(1)
- fsin
- ret
-3:
-#ifdef PIC
- pushl %ebx
- cfi_adjust_cfa_offset (4)
- cfi_rel_offset (ebx, 0)
- LOAD_PIC_REG (bx)
- call __errno_location@PLT
- movl $EDOM, (%eax)
- popl %ebx
- cfi_adjust_cfa_offset (-4)
- cfi_restore (ebx)
-#else
- call __errno_location@PLT
- movl $EDOM, (%eax)
-#endif
- jmp 4b
-END (__sinl)
-weak_alias (__sinl, sinl)
diff --git a/libc/sysdeps/i386/fpu/s_tan.S b/libc/sysdeps/i386/fpu/s_tan.S
deleted file mode 100644
index b35bb835d..000000000
--- a/libc/sysdeps/i386/fpu/s_tan.S
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Written by J.T. Conklin <jtc@netbsd.org>.
- * Fixed errno handling by Ulrich Drepper <drepper@redhat.com>.
- * Public domain.
- */
-
-#define __need_Emath
-#include <bits/errno.h>
-#include <machine/asm.h>
-
-RCSID("$NetBSD: s_tan.S,v 1.5 1995/05/09 00:30:00 jtc Exp $")
-
-ENTRY(__tan)
- fldl 4(%esp)
- fxam
- fstsw %ax
- movb $0x45, %dh
- andb %ah, %dh
- cmpb $0x05, %dh
- je 3f
-4: fptan
- fnstsw %ax
- testl $0x400,%eax
- jnz 1f
- fstp %st(0)
- ret
-1: fldpi
- fadd %st(0)
- fxch %st(1)
-2: fprem1
- fstsw %ax
- testl $0x400,%eax
- jnz 2b
- fstp %st(1)
- fptan
- fstp %st(0)
- ret
-3:
-#ifdef PIC
- pushl %ebx
- cfi_adjust_cfa_offset (4)
- cfi_rel_offset (ebx, 0)
- LOAD_PIC_REG (bx)
- call __errno_location@PLT
- movl $EDOM, (%eax)
- popl %ebx
- cfi_adjust_cfa_offset (-4)
- cfi_restore (ebx)
-#else
- call __errno_location@PLT
- movl $EDOM, (%eax)
-#endif
- jmp 4b
-END (__tan)
-weak_alias (__tan, tan)
diff --git a/libc/sysdeps/i386/fpu/s_tanf.S b/libc/sysdeps/i386/fpu/s_tanf.S
deleted file mode 100644
index 74bc22fce..000000000
--- a/libc/sysdeps/i386/fpu/s_tanf.S
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Written by J.T. Conklin <jtc@netbsd.org>.
- * Fixed errno handling by Ulrich Drepper <drepper@redhat.com>.
- * Public domain.
- */
-
-#define __need_Emath
-#include <bits/errno.h>
-#include <machine/asm.h>
-
-RCSID("$NetBSD: s_tanf.S,v 1.3 1995/05/09 00:31:09 jtc Exp $")
-
-ENTRY(__tanf)
- flds 4(%esp)
- fxam
- fstsw %ax
- movb $0x45, %dh
- andb %ah, %dh
- cmpb $0x05, %dh
- je 3f
-4: fptan
- fnstsw %ax
- testl $0x400,%eax
- jnz 1f
- fstp %st(0)
- ret
-1: fldpi
- fadd %st(0)
- fxch %st(1)
-2: fprem1
- fstsw %ax
- testl $0x400,%eax
- jnz 2b
- fstp %st(1)
- fptan
- fstp %st(0)
- ret
-3:
-#ifdef PIC
- pushl %ebx
- cfi_adjust_cfa_offset (4)
- cfi_rel_offset (ebx, 0)
- LOAD_PIC_REG (bx)
- call __errno_location@PLT
- movl $EDOM, (%eax)
- popl %ebx
- cfi_adjust_cfa_offset (-4)
- cfi_restore (ebx)
-#else
- call __errno_location@PLT
- movl $EDOM, (%eax)
-#endif
- jmp 4b
-END (__tanf)
-weak_alias (__tanf, tanf)
diff --git a/libc/sysdeps/i386/fpu/s_tanl.S b/libc/sysdeps/i386/fpu/s_tanl.S
deleted file mode 100644
index 151b77113..000000000
--- a/libc/sysdeps/i386/fpu/s_tanl.S
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Written by J.T. Conklin <jtc@netbsd.org>.
- * Public domain.
- *
- * Adapted for `long double' by Ulrich Drepper <drepper@cygnus.com>.
- * Fixed errno handling by Ulrich Drepper <drepper@redhat.com>.
- */
-
-#define __need_Emath
-#include <bits/errno.h>
-#include <machine/asm.h>
-
-ENTRY(__tanl)
- fldt 4(%esp)
- fxam
- fstsw %ax
- movb $0x45, %dh
- andb %ah, %dh
- cmpb $0x05, %dh
- je 3f
-4: fptan
- fnstsw %ax
- testl $0x400,%eax
- jnz 1f
- fstp %st(0)
- ret
-1: fldpi
- fadd %st(0)
- fxch %st(1)
-2: fprem1
- fstsw %ax
- testl $0x400,%eax
- jnz 2b
- fstp %st(1)
- fptan
- fstp %st(0)
- ret
-3:
-#ifdef PIC
- pushl %ebx
- cfi_adjust_cfa_offset (4)
- cfi_rel_offset (ebx, 0)
- LOAD_PIC_REG (bx)
- call __errno_location@PLT
- movl $EDOM, (%eax)
- popl %ebx
- cfi_adjust_cfa_offset (-4)
- cfi_restore (ebx)
-#else
- call __errno_location@PLT
- movl $EDOM, (%eax)
-#endif
- jmp 4b
-END (__tanl)
-weak_alias (__tanl, tanl)
diff --git a/libc/sysdeps/i386/fpu/sincos32.c b/libc/sysdeps/i386/fpu/sincos32.c
deleted file mode 100644
index 1cc893170..000000000
--- a/libc/sysdeps/i386/fpu/sincos32.c
+++ /dev/null
@@ -1 +0,0 @@
-/* Not needed. */
diff --git a/libc/sysdeps/i386/i686/hp-timing.h b/libc/sysdeps/i386/i686/hp-timing.h
index 852f77820..1d8684ce2 100644
--- a/libc/sysdeps/i386/i686/hp-timing.h
+++ b/libc/sysdeps/i386/i686/hp-timing.h
@@ -22,7 +22,7 @@
#include <string.h>
#include <sys/param.h>
-#include <stdio-common/_itoa.h>
+#include <_itoa.h>
/* The macros defined here use the timestamp counter in i586 and up versions
of the x86 processors. They provide a very accurate way to measure the
diff --git a/libc/sysdeps/ieee754/dbl-64/e_atan2.c b/libc/sysdeps/ieee754/dbl-64/e_atan2.c
index dcef55f07..497afcab1 100644
--- a/libc/sysdeps/ieee754/dbl-64/e_atan2.c
+++ b/libc/sysdeps/ieee754/dbl-64/e_atan2.c
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* written by International Business Machines Corp.
- * Copyright (C) 2001, 2011 Free Software Foundation
+ * Copyright (C) 2001-2012 Free Software Foundation
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -153,6 +153,13 @@ __ieee754_atan2(double y,double x) {
/* if either x or y is extremely close to zero, scale abs(x), abs(y). */
if (ax<twom500.d || ay<twom500.d) { ax*=two500.d; ay*=two500.d; }
+ /* Likewise for large x and y. */
+ if (ax > two500.d || ay > two500.d)
+ {
+ ax *= twom500.d;
+ ay *= twom500.d;
+ }
+
/* x,y which are neither special nor extreme */
if (ay<ax) {
u=ay/ax;
diff --git a/libc/sysdeps/ieee754/dbl-64/e_exp.c b/libc/sysdeps/ieee754/dbl-64/e_exp.c
index cb8d9e8d9..5deba5e44 100644
--- a/libc/sysdeps/ieee754/dbl-64/e_exp.c
+++ b/libc/sysdeps/ieee754/dbl-64/e_exp.c
@@ -59,10 +59,9 @@ __ieee754_exp(double x) {
int4 k;
#endif
int4 i,j,m,n,ex;
- fenv_t env;
double retval;
- libc_feholdexcept_setround (&env, FE_TONEAREST);
+ SET_RESTORE_ROUND (FE_TONEAREST);
junk1.x = x;
m = junk1.i[HIGH_HALF];
@@ -157,7 +156,6 @@ __ieee754_exp(double x) {
else { retval = __slowexp(x); goto ret; }
}
ret:
- libc_feupdateenv (&env);
return retval;
}
#ifndef __ieee754_exp
diff --git a/libc/sysdeps/ieee754/dbl-64/e_exp2.c b/libc/sysdeps/ieee754/dbl-64/e_exp2.c
index 4cf879b7f..e57ec9211 100644
--- a/libc/sysdeps/ieee754/dbl-64/e_exp2.c
+++ b/libc/sysdeps/ieee754/dbl-64/e_exp2.c
@@ -61,57 +61,56 @@ __ieee754_exp2 (double x)
int tval, unsafe;
double rx, x22, result;
union ieee754_double ex2_u, scale_u;
- fenv_t oldenv;
-
- libc_feholdexcept_setround (&oldenv, FE_TONEAREST);
-
- /* 1. Argument reduction.
- Choose integers ex, -256 <= t < 256, and some real
- -1/1024 <= x1 <= 1024 so that
- x = ex + t/512 + x1.
-
- First, calculate rx = ex + t/512. */
- rx = x + THREEp42;
- rx -= THREEp42;
- x -= rx; /* Compute x=x1. */
- /* Compute tval = (ex*512 + t)+256.
- Now, t = (tval mod 512)-256 and ex=tval/512 [that's mod, NOT %; and
- /-round-to-nearest not the usual c integer /]. */
- tval = (int) (rx * 512.0 + 256.0);
-
- /* 2. Adjust for accurate table entry.
- Find e so that
- x = ex + t/512 + e + x2
- where -1e6 < e < 1e6, and
- (double)(2^(t/512+e))
- is accurate to one part in 2^-64. */
-
- /* 'tval & 511' is the same as 'tval%512' except that it's always
- positive.
- Compute x = x2. */
- x -= exp2_deltatable[tval & 511];
-
- /* 3. Compute ex2 = 2^(t/512+e+ex). */
- ex2_u.d = exp2_accuratetable[tval & 511];
- tval >>= 9;
- unsafe = abs(tval) >= -DBL_MIN_EXP - 1;
- ex2_u.ieee.exponent += tval >> unsafe;
- scale_u.d = 1.0;
- scale_u.ieee.exponent += tval - (tval >> unsafe);
-
- /* 4. Approximate 2^x2 - 1, using a fourth-degree polynomial,
- with maximum error in [-2^-10-2^-30,2^-10+2^-30]
- less than 10^-19. */
-
- x22 = (((.0096181293647031180
- * x + .055504110254308625)
- * x + .240226506959100583)
- * x + .69314718055994495) * ex2_u.d;
- math_opt_barrier (x22);
- /* 5. Return (2^x2-1) * 2^(t/512+e+ex) + 2^(t/512+e+ex). */
- libc_fesetenv (&oldenv);
+ {
+ SET_RESTORE_ROUND_NOEX (FE_TONEAREST);
+
+ /* 1. Argument reduction.
+ Choose integers ex, -256 <= t < 256, and some real
+ -1/1024 <= x1 <= 1024 so that
+ x = ex + t/512 + x1.
+
+ First, calculate rx = ex + t/512. */
+ rx = x + THREEp42;
+ rx -= THREEp42;
+ x -= rx; /* Compute x=x1. */
+ /* Compute tval = (ex*512 + t)+256.
+ Now, t = (tval mod 512)-256 and ex=tval/512 [that's mod, NOT %;
+ and /-round-to-nearest not the usual c integer /]. */
+ tval = (int) (rx * 512.0 + 256.0);
+
+ /* 2. Adjust for accurate table entry.
+ Find e so that
+ x = ex + t/512 + e + x2
+ where -1e6 < e < 1e6, and
+ (double)(2^(t/512+e))
+ is accurate to one part in 2^-64. */
+
+ /* 'tval & 511' is the same as 'tval%512' except that it's always
+ positive.
+ Compute x = x2. */
+ x -= exp2_deltatable[tval & 511];
+
+ /* 3. Compute ex2 = 2^(t/512+e+ex). */
+ ex2_u.d = exp2_accuratetable[tval & 511];
+ tval >>= 9;
+ unsafe = abs(tval) >= -DBL_MIN_EXP - 1;
+ ex2_u.ieee.exponent += tval >> unsafe;
+ scale_u.d = 1.0;
+ scale_u.ieee.exponent += tval - (tval >> unsafe);
+
+ /* 4. Approximate 2^x2 - 1, using a fourth-degree polynomial,
+ with maximum error in [-2^-10-2^-30,2^-10+2^-30]
+ less than 10^-19. */
+
+ x22 = (((.0096181293647031180
+ * x + .055504110254308625)
+ * x + .240226506959100583)
+ * x + .69314718055994495) * ex2_u.d;
+ math_opt_barrier (x22);
+ }
+ /* 5. Return (2^x2-1) * 2^(t/512+e+ex) + 2^(t/512+e+ex). */
result = x22 * x + ex2_u.d;
if (!unsafe)
diff --git a/libc/sysdeps/ieee754/dbl-64/e_pow.c b/libc/sysdeps/ieee754/dbl-64/e_pow.c
index 550633cf9..26ffaaddc 100644
--- a/libc/sysdeps/ieee754/dbl-64/e_pow.c
+++ b/libc/sysdeps/ieee754/dbl-64/e_pow.c
@@ -85,10 +85,9 @@ __ieee754_pow(double x, double y) {
(u.i[HIGH_HALF]==0 && u.i[LOW_HALF]!=0)) &&
/* 2^-1023< x<= 2^-1023 * 0x1.0000ffffffff */
(v.i[HIGH_HALF]&0x7fffffff) < 0x4ff00000) { /* if y<-1 or y>1 */
- fenv_t env;
double retval;
- libc_feholdexcept_setround (&env, FE_TONEAREST);
+ SET_RESTORE_ROUND (FE_TONEAREST);
z = log1(x,&aa,&error); /* x^y =e^(y log (X)) */
t = y*134217729.0;
@@ -105,7 +104,6 @@ __ieee754_pow(double x, double y) {
t = __exp1(a1,a2,1.9e16*error); /* return -10 or 0 if wasn't computed exactly */
retval = (t>0)?t:power1(x,y);
- libc_feupdateenv (&env);
return retval;
}
@@ -113,7 +111,7 @@ __ieee754_pow(double x, double y) {
if (((v.i[HIGH_HALF] & 0x7fffffff) == 0x7ff00000 && v.i[LOW_HALF] != 0)
|| (v.i[HIGH_HALF] & 0x7fffffff) > 0x7ff00000)
return y;
- if (ABS(y) > 1.0e20) return (y>0)?0:INF.x;
+ if (ABS(y) > 1.0e20) return (y>0)?0:1.0/ABS(x);
k = checkint(y);
if (k == -1)
return y < 0 ? 1.0/x : x;
diff --git a/libc/sysdeps/ieee754/dbl-64/k_rem_pio2.c b/libc/sysdeps/ieee754/dbl-64/k_rem_pio2.c
index a1e0c6d72..fcf956afb 100644
--- a/libc/sysdeps/ieee754/dbl-64/k_rem_pio2.c
+++ b/libc/sysdeps/ieee754/dbl-64/k_rem_pio2.c
@@ -273,13 +273,16 @@ recompute:
y[0] = (ih==0)? fw: -fw;
break;
case 1:
- case 2:
- fw = 0.0;
- for (i=jz;i>=0;i--) fw += fq[i];
- y[0] = (ih==0)? fw: -fw;
- fw = fq[0]-fw;
- for (i=1;i<=jz;i++) fw += fq[i];
- y[1] = (ih==0)? fw: -fw;
+ case 2:;
+#if __FLT_EVAL_METHOD__ != 0
+ volatile
+#endif
+ double fv = 0.0;
+ for (i=jz;i>=0;i--) fv += fq[i];
+ y[0] = (ih==0)? fv: -fv;
+ fv = fq[0]-fv;
+ for (i=1;i<=jz;i++) fv += fq[i];
+ y[1] = (ih==0)? fv: -fv;
break;
case 3: /* painful */
for (i=jz;i>0;i--) {
diff --git a/libc/sysdeps/ieee754/dbl-64/s_fma.c b/libc/sysdeps/ieee754/dbl-64/s_fma.c
index a27e246a4..ab20a801a 100644
--- a/libc/sysdeps/ieee754/dbl-64/s_fma.c
+++ b/libc/sysdeps/ieee754/dbl-64/s_fma.c
@@ -149,35 +149,36 @@ __fma (double x, double y, double z)
fenv_t env;
libc_feholdexcept_setround (&env, FE_TOWARDZERO);
+
/* Perform m2 + a2 addition with round to odd. */
u.d = a2 + m2;
+ if (__builtin_expect (adjust < 0, 0))
+ {
+ if ((u.ieee.mantissa1 & 1) == 0)
+ u.ieee.mantissa1 |= libc_fetestexcept (FE_INEXACT) != 0;
+ v.d = a1 + u.d;
+ }
+
+ /* Reset rounding mode and test for inexact simultaneously. */
+ int j = libc_feupdateenv_test (&env, FE_INEXACT) != 0;
+
if (__builtin_expect (adjust == 0, 1))
{
if ((u.ieee.mantissa1 & 1) == 0 && u.ieee.exponent != 0x7ff)
- u.ieee.mantissa1 |= libc_fetestexcept (FE_INEXACT) != 0;
- libc_feupdateenv (&env);
+ u.ieee.mantissa1 |= j;
/* Result is a1 + u.d. */
return a1 + u.d;
}
else if (__builtin_expect (adjust > 0, 1))
{
if ((u.ieee.mantissa1 & 1) == 0 && u.ieee.exponent != 0x7ff)
- u.ieee.mantissa1 |= libc_fetestexcept (FE_INEXACT) != 0;
- libc_feupdateenv (&env);
+ u.ieee.mantissa1 |= j;
/* Result is a1 + u.d, scaled up. */
return (a1 + u.d) * 0x1p53;
}
else
{
- if ((u.ieee.mantissa1 & 1) == 0)
- u.ieee.mantissa1 |= libc_fetestexcept (FE_INEXACT) != 0;
- v.d = a1 + u.d;
- int j = libc_fetestexcept (FE_INEXACT) != 0;
- libc_feupdateenv (&env);
- /* Ensure the following computations are performed in default rounding
- mode instead of just reusing the round to zero computation. */
- asm volatile ("" : "=m" (u) : "m" (u));
/* If a1 + u.d is exact, the only rounding happens during
scaling down. */
if (j == 0)
diff --git a/libc/sysdeps/ieee754/dbl-64/s_fmaf.c b/libc/sysdeps/ieee754/dbl-64/s_fmaf.c
index 00cd38270..7a939aaed 100644
--- a/libc/sysdeps/ieee754/dbl-64/s_fmaf.c
+++ b/libc/sysdeps/ieee754/dbl-64/s_fmaf.c
@@ -35,12 +35,18 @@ __fmaf (float x, float y, float z)
/* Multiplication is always exact. */
double temp = (double) x * (double) y;
union ieee754_double u;
- libc_feholdexcept_setroundf (&env, FE_TOWARDZERO);
+
+ libc_feholdexcept_setround (&env, FE_TOWARDZERO);
+
/* Perform addition with round to odd. */
u.d = temp + (double) z;
+
+ /* Reset rounding mode and test for inexact simultaneously. */
+ int j = libc_feupdateenv_test (&env, FE_INEXACT) != 0;
+
if ((u.ieee.mantissa1 & 1) == 0 && u.ieee.exponent != 0x7ff)
- u.ieee.mantissa1 |= libc_fetestexcept (FE_INEXACT) != 0;
- libc_feupdateenv (&env);
+ u.ieee.mantissa1 |= j;
+
/* And finally truncation with round to nearest. */
return (float) u.d;
}
diff --git a/libc/sysdeps/ieee754/dbl-64/s_nearbyint.c b/libc/sysdeps/ieee754/dbl-64/s_nearbyint.c
index d780150a9..60afafded 100644
--- a/libc/sysdeps/ieee754/dbl-64/s_nearbyint.c
+++ b/libc/sysdeps/ieee754/dbl-64/s_nearbyint.c
@@ -38,18 +38,12 @@ double __nearbyint(double x)
{
fenv_t env;
int32_t i0,j0,sx;
- u_int32_t i,i1;
double w,t;
- EXTRACT_WORDS(i0,i1,x);
+ GET_HIGH_WORD(i0,x);
sx = (i0>>31)&1;
j0 = ((i0>>20)&0x7ff)-0x3ff;
- if(j0<20) {
+ if(j0<52) {
if(j0<0) {
- if(((i0&0x7fffffff)|i1)==0) return x;
- i1 |= (i0&0x0fffff);
- i0 &= 0xfffe0000;
- i0 |= ((i1|-i1)>>12)&0x80000;
- SET_HIGH_WORD(x,i0);
feholdexcept (&env);
w = TWO52[sx]+x;
t = w-TWO52[sx];
@@ -57,32 +51,11 @@ double __nearbyint(double x)
GET_HIGH_WORD(i0,t);
SET_HIGH_WORD(t,(i0&0x7fffffff)|(sx<<31));
return t;
- } else {
- i = (0x000fffff)>>j0;
- if(((i0&i)|i1)==0) return x; /* x is integral */
- i>>=1;
- if(((i0&i)|i1)!=0) {
- if (j0==19)
- i1 = 0x40000000;
- else if (j0<18)
- i0 = (i0&(~i))|((0x20000)>>j0);
- else
- {
- i0 &= ~i;
- i1 = 0x80000000;
- }
- }
}
- } else if (j0>51) {
+ } else {
if(j0==0x400) return x+x; /* inf or NaN */
else return x; /* x is integral */
- } else {
- i = ((u_int32_t)(0xffffffff))>>(j0-20);
- if((i1&i)==0) return x; /* x is integral */
- i>>=1;
- if((i1&i)!=0) i1 = (i1&(~i))|((0x40000000)>>(j0-20));
}
- INSERT_WORDS(x,i0,i1);
feholdexcept (&env);
w = TWO52[sx]+x;
t = w-TWO52[sx];
diff --git a/libc/sysdeps/ieee754/dbl-64/s_rint.c b/libc/sysdeps/ieee754/dbl-64/s_rint.c
index c45d7848d..845890916 100644
--- a/libc/sysdeps/ieee754/dbl-64/s_rint.c
+++ b/libc/sysdeps/ieee754/dbl-64/s_rint.c
@@ -33,49 +33,22 @@ double
__rint(double x)
{
int32_t i0,j0,sx;
- u_int32_t i,i1;
double w,t;
- EXTRACT_WORDS(i0,i1,x);
+ GET_HIGH_WORD(i0,x);
sx = (i0>>31)&1;
j0 = ((i0>>20)&0x7ff)-0x3ff;
- if(j0<20) {
+ if(j0<52) {
if(j0<0) {
- if(((i0&0x7fffffff)|i1)==0) return x;
- i1 |= (i0&0x0fffff);
- i0 &= 0xfffe0000;
- i0 |= ((i1|-i1)>>12)&0x80000;
- SET_HIGH_WORD(x,i0);
w = TWO52[sx]+x;
t = w-TWO52[sx];
GET_HIGH_WORD(i0,t);
SET_HIGH_WORD(t,(i0&0x7fffffff)|(sx<<31));
return t;
- } else {
- i = (0x000fffff)>>j0;
- if(((i0&i)|i1)==0) return x; /* x is integral */
- i>>=1;
- if(((i0&i)|i1)!=0) {
- if (j0==19)
- i1 = 0x40000000;
- else if (j0<18)
- i0 = (i0&(~i))|((0x20000)>>j0);
- else
- {
- i0 &= ~i;
- i1 = 0x80000000;
- }
- }
}
- } else if (j0>51) {
+ } else {
if(j0==0x400) return x+x; /* inf or NaN */
else return x; /* x is integral */
- } else {
- i = ((u_int32_t)(0xffffffff))>>(j0-20);
- if((i1&i)==0) return x; /* x is integral */
- i>>=1;
- if((i1&i)!=0) i1 = (i1&(~i))|((0x40000000)>>(j0-20));
}
- INSERT_WORDS(x,i0,i1);
w = TWO52[sx]+x;
return w-TWO52[sx];
}
diff --git a/libc/sysdeps/ieee754/dbl-64/s_sin.c b/libc/sysdeps/ieee754/dbl-64/s_sin.c
index e3e3a2a96..7b9252f81 100644
--- a/libc/sysdeps/ieee754/dbl-64/s_sin.c
+++ b/libc/sysdeps/ieee754/dbl-64/s_sin.c
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* written by International Business Machines Corp.
- * Copyright (C) 2001, 2009, 2011 Free Software Foundation
+ * Copyright (C) 2001-2012 Free Software Foundation
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -108,10 +108,9 @@ __sin(double x){
#if 0
int4 nn;
#endif
- fenv_t env;
double retval = 0;
- libc_feholdexcept_setround (&env, FE_TONEAREST);
+ SET_RESTORE_ROUND_53BIT (FE_TONEAREST);
u.x = x;
m = u.i[HIGH_HALF];
@@ -365,7 +364,6 @@ __sin(double x){
}
ret:
- libc_feupdateenv (&env);
return retval;
}
@@ -383,10 +381,9 @@ __cos(double x)
mynumber u,v;
int4 k,m,n;
- fenv_t env;
double retval = 0;
- libc_feholdexcept_setround (&env, FE_TONEAREST);
+ SET_RESTORE_ROUND_53BIT (FE_TONEAREST);
u.x = x;
m = u.i[HIGH_HALF];
@@ -635,7 +632,6 @@ __cos(double x)
}
ret:
- libc_feupdateenv (&env);
return retval;
}
diff --git a/libc/sysdeps/ieee754/dbl-64/s_tan.c b/libc/sysdeps/ieee754/dbl-64/s_tan.c
index acff67c98..f8507eaa4 100644
--- a/libc/sysdeps/ieee754/dbl-64/s_tan.c
+++ b/libc/sysdeps/ieee754/dbl-64/s_tan.c
@@ -68,13 +68,12 @@ tan(double x) {
mp_no mpy;
#endif
- fenv_t env;
double retval;
int __branred(double, double *, double *);
int __mpranred(double, mp_no *, int);
- libc_feholdexcept_setround (&env, FE_TONEAREST);
+ SET_RESTORE_ROUND_53BIT (FE_TONEAREST);
/* x=+-INF, x=NaN */
num.d = x; ux = num.i[HIGH_HALF];
@@ -503,7 +502,6 @@ tan(double x) {
goto ret;
ret:
- libc_feupdateenv (&env);
return retval;
}
diff --git a/libc/sysdeps/ieee754/dbl-64/wordsize-64/math_private.h b/libc/sysdeps/ieee754/dbl-64/wordsize-64/math_private.h
new file mode 100644
index 000000000..b66085eb1
--- /dev/null
+++ b/libc/sysdeps/ieee754/dbl-64/wordsize-64/math_private.h
@@ -0,0 +1,35 @@
+#ifndef _MATH_PRIVATE_H_
+
+#include_next <math_private.h>
+
+#ifndef __isnan
+extern __always_inline int
+__isnan (double d)
+{
+ uint64_t di;
+ EXTRACT_WORDS64 (di, d);
+ return (di & 0x7fffffffffffffffull) > 0x7ff0000000000000ull;
+}
+#endif
+
+#ifndef __isinf_ns
+extern __always_inline int
+__isinf_ns (double d)
+{
+ uint64_t di;
+ EXTRACT_WORDS64 (di, d);
+ return (di & 0x7fffffffffffffffull) == 0x7ff0000000000000ull;
+}
+#endif
+
+#ifndef __finite
+extern __always_inline int
+__finite (double d)
+{
+ uint64_t di;
+ EXTRACT_WORDS64 (di, d);
+ return (di & 0x7fffffffffffffffull) < 0x7ff0000000000000ull;
+}
+#endif
+
+#endif /* _MATH_PRIVATE_H_ */
diff --git a/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_llround.c b/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_llround.c
index f7c9ea568..4a72005d0 100644
--- a/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_llround.c
+++ b/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_llround.c
@@ -1 +1,79 @@
-/* The code is the same as lround. Use an alias, see l_round.c. */
+/* Round double value to long long int.
+ Copyright (C) 1997-2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define lround __hidden_lround
+#define __lround __hidden___lround
+
+#include <math.h>
+
+#include <math_private.h>
+
+
+long long int
+__llround (double x)
+{
+ int32_t j0;
+ int64_t i0;
+ long long int result;
+ int sign;
+
+ EXTRACT_WORDS64 (i0, x);
+ j0 = ((i0 >> 52) & 0x7ff) - 0x3ff;
+ sign = i0 < 0 ? -1 : 1;
+ i0 &= UINT64_C(0xfffffffffffff);
+ i0 |= UINT64_C(0x10000000000000);
+
+ if (j0 < (int32_t) (8 * sizeof (long long int)) - 1)
+ {
+ if (j0 < 0)
+ return j0 < -1 ? 0 : sign;
+ else if (j0 >= 52)
+ result = i0 << (j0 - 52);
+ else
+ {
+ i0 += UINT64_C(0x8000000000000) >> j0;
+
+ result = i0 >> (52 - j0);
+ }
+ }
+ else
+ {
+ /* The number is too large. It is left implementation defined
+ what happens. */
+ return (long long int) x;
+ }
+
+ return sign * result;
+}
+
+weak_alias (__llround, llround)
+#ifdef NO_LONG_DOUBLE
+strong_alias (__llround, __lroundl)
+weak_alias (__llround, lroundl)
+#endif
+
+/* long has the same width as long long on 64-bit machines. */
+#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
diff --git a/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_lround.c b/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_lround.c
index e3a1db0d5..1e06fcb16 100644
--- a/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_lround.c
+++ b/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_lround.c
@@ -1,79 +1 @@
-/* Round double value to long int.
- Copyright (C) 1997, 2004, 2009 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#define llround __hidden_llround
-#define __llround __hidden___llround
-
-#include <math.h>
-
-#include <math_private.h>
-
-
-long int
-__lround (double x)
-{
- int32_t j0;
- int64_t i0;
- long int result;
- int sign;
-
- EXTRACT_WORDS64 (i0, x);
- j0 = ((i0 >> 52) & 0x7ff) - 0x3ff;
- sign = i0 < 0 ? -1 : 1;
- i0 &= UINT64_C(0xfffffffffffff);
- i0 |= UINT64_C(0x10000000000000);
-
- if (j0 < (int32_t) (8 * sizeof (long int)) - 1)
- {
- if (j0 < 0)
- return j0 < -1 ? 0 : sign;
- else if (j0 >= 52)
- result = i0 << (j0 - 52);
- else
- {
- i0 += UINT64_C(0x8000000000000) >> j0;
-
- result = i0 >> (52 - j0);
- }
- }
- else
- {
- /* The number is too large. It is left implementation defined
- what happens. */
- return (long int) x;
- }
-
- return sign * result;
-}
-
-weak_alias (__lround, lround)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__lround, __lroundl)
-weak_alias (__lround, lroundl)
-#endif
-
-/* long long has the same width as long on 64-bit machines. */
-#undef llround
-#undef __llround
-strong_alias (__lround, __llround)
-weak_alias (__lround, llround)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__lround, __llroundl)
-weak_alias (__lround, llroundl)
-#endif
+/* The code is the same as llround. Use an alias, see s_llround.c. */
diff --git a/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_nearbyint.c b/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_nearbyint.c
index a3809984e..a58a6202e 100644
--- a/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_nearbyint.c
+++ b/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_nearbyint.c
@@ -41,29 +41,17 @@ __nearbyint(double x)
j0 = ((i0>>52)&0x7ff)-0x3ff;
if(__builtin_expect(j0<52, 1)) {
if(j0<0) {
- if((i0&UINT64_C(0x7fffffffffffffff))==0) return x;
- uint64_t i = i0 & UINT64_C(0xfffffffffffff);
- i0 &= UINT64_C(0xfffe000000000000);
- i0 |= (((i|-i) >> 12) & UINT64_C(0x8000000000000));
- INSERT_WORDS64(x,i0);
libc_feholdexcept (&env);
double w = TWO52[sx]+x;
double t = w-TWO52[sx];
math_opt_barrier(t);
libc_fesetenv (&env);
return copysign(t, x);
- } else {
- uint64_t i = UINT64_C(0x000fffffffffffff)>>j0;
- if((i0&i)==0) return x; /* x is integral */
- i>>=1;
- if((i0&i)!=0)
- i0 = (i0&(~i))|(UINT64_C(0x4000000000000)>>j0);
}
} else {
if(j0==0x400) return x+x; /* inf or NaN */
else return x; /* x is integral */
}
- INSERT_WORDS64(x,i0);
libc_feholdexcept (&env);
double w = TWO52[sx]+x;
double t = w-TWO52[sx];
diff --git a/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_rint.c b/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_rint.c
index 20eef3c5e..87b2339d4 100644
--- a/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_rint.c
+++ b/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_rint.c
@@ -38,28 +38,16 @@ __rint(double x)
j0 = ((i0>>52)&0x7ff)-0x3ff;
if(j0<52) {
if(j0<0) {
- if((i0 & UINT64_C(0x7fffffffffffffff))==0) return x;
- uint64_t i = i0 & UINT64_C(0xfffffffffffff);
- i0 &= UINT64_C(0xfffe000000000000);
- i0 |= (((i|-i) >> 12) & UINT64_C(0x8000000000000));
- INSERT_WORDS64(x,i0);
double w = TWO52[sx]+x;
double t = w-TWO52[sx];
EXTRACT_WORDS64(i0,t);
INSERT_WORDS64(t,(i0&UINT64_C(0x7fffffffffffffff))|(sx<<63));
return t;
- } else {
- uint64_t i = UINT64_C(0x000fffffffffffff)>>j0;
- if((i0&i)==0) return x; /* x is integral */
- i>>=1;
- if((i0&i)!=0)
- i0 = (i0&(~i))|(UINT64_C(0x4000000000000)>>j0);
}
} else {
if(j0==0x400) return x+x; /* inf or NaN */
else return x; /* x is integral */
}
- INSERT_WORDS64(x,i0);
double w = TWO52[sx]+x;
return w-TWO52[sx];
}
diff --git a/libc/sysdeps/ieee754/flt-32/e_exp2f.c b/libc/sysdeps/ieee754/flt-32/e_exp2f.c
index e728e6ec7..267d81b23 100644
--- a/libc/sysdeps/ieee754/flt-32/e_exp2f.c
+++ b/libc/sysdeps/ieee754/flt-32/e_exp2f.c
@@ -54,53 +54,52 @@ __ieee754_exp2f (float x)
int tval, unsafe;
float rx, x22, result;
union ieee754_float ex2_u, scale_u;
- fenv_t oldenv;
-
- libc_feholdexcept_setroundf (&oldenv, FE_TONEAREST);
-
- /* 1. Argument reduction.
- Choose integers ex, -128 <= t < 128, and some real
- -1/512 <= x1 <= 1/512 so that
- x = ex + t/512 + x1.
-
- First, calculate rx = ex + t/256. */
- rx = x + THREEp14;
- rx -= THREEp14;
- x -= rx; /* Compute x=x1. */
- /* Compute tval = (ex*256 + t)+128.
- Now, t = (tval mod 256)-128 and ex=tval/256 [that's mod, NOT %; and
- /-round-to-nearest not the usual c integer /]. */
- tval = (int) (rx * 256.0f + 128.0f);
-
- /* 2. Adjust for accurate table entry.
- Find e so that
- x = ex + t/256 + e + x2
- where -7e-4 < e < 7e-4, and
- (float)(2^(t/256+e))
- is accurate to one part in 2^-64. */
-
- /* 'tval & 255' is the same as 'tval%256' except that it's always
- positive.
- Compute x = x2. */
- x -= __exp2f_deltatable[tval & 255];
-
- /* 3. Compute ex2 = 2^(t/255+e+ex). */
- ex2_u.f = __exp2f_atable[tval & 255];
- tval >>= 8;
- unsafe = abs(tval) >= -FLT_MIN_EXP - 1;
- ex2_u.ieee.exponent += tval >> unsafe;
- scale_u.f = 1.0;
- scale_u.ieee.exponent += tval - (tval >> unsafe);
-
- /* 4. Approximate 2^x2 - 1, using a second-degree polynomial,
- with maximum error in [-2^-9 - 2^-14, 2^-9 + 2^-14]
- less than 1.3e-10. */
-
- x22 = (.24022656679f * x + .69314736128f) * ex2_u.f;
- /* 5. Return (2^x2-1) * 2^(t/512+e+ex) + 2^(t/512+e+ex). */
- libc_fesetenv (&oldenv);
+ {
+ SET_RESTORE_ROUND_NOEXF (FE_TONEAREST);
+
+ /* 1. Argument reduction.
+ Choose integers ex, -128 <= t < 128, and some real
+ -1/512 <= x1 <= 1/512 so that
+ x = ex + t/512 + x1.
+
+ First, calculate rx = ex + t/256. */
+ rx = x + THREEp14;
+ rx -= THREEp14;
+ x -= rx; /* Compute x=x1. */
+ /* Compute tval = (ex*256 + t)+128.
+ Now, t = (tval mod 256)-128 and ex=tval/256 [that's mod, NOT %;
+ and /-round-to-nearest not the usual c integer /]. */
+ tval = (int) (rx * 256.0f + 128.0f);
+
+ /* 2. Adjust for accurate table entry.
+ Find e so that
+ x = ex + t/256 + e + x2
+ where -7e-4 < e < 7e-4, and
+ (float)(2^(t/256+e))
+ is accurate to one part in 2^-64. */
+
+ /* 'tval & 255' is the same as 'tval%256' except that it's always
+ positive.
+ Compute x = x2. */
+ x -= __exp2f_deltatable[tval & 255];
+
+ /* 3. Compute ex2 = 2^(t/255+e+ex). */
+ ex2_u.f = __exp2f_atable[tval & 255];
+ tval >>= 8;
+ unsafe = abs(tval) >= -FLT_MIN_EXP - 1;
+ ex2_u.ieee.exponent += tval >> unsafe;
+ scale_u.f = 1.0;
+ scale_u.ieee.exponent += tval - (tval >> unsafe);
+
+ /* 4. Approximate 2^x2 - 1, using a second-degree polynomial,
+ with maximum error in [-2^-9 - 2^-14, 2^-9 + 2^-14]
+ less than 1.3e-10. */
+
+ x22 = (.24022656679f * x + .69314736128f) * ex2_u.f;
+ }
+ /* 5. Return (2^x2-1) * 2^(t/512+e+ex) + 2^(t/512+e+ex). */
result = x22 * x + ex2_u.f;
if (!unsafe)
diff --git a/libc/sysdeps/ieee754/flt-32/e_expf.c b/libc/sysdeps/ieee754/flt-32/e_expf.c
index e69e7f6ae..57aff16ab 100644
--- a/libc/sysdeps/ieee754/flt-32/e_expf.c
+++ b/libc/sysdeps/ieee754/flt-32/e_expf.c
@@ -80,40 +80,39 @@ __ieee754_expf (float x)
double x22, t, result, dx;
float n, delta;
union ieee754_double ex2_u;
- fenv_t oldenv;
- libc_feholdexcept_setroundf (&oldenv, FE_TONEAREST);
+ {
+ SET_RESTORE_ROUND_NOEXF (FE_TONEAREST);
- /* Calculate n. */
- n = x * M_1_LN2 + THREEp22;
- n -= THREEp22;
- dx = x - n*M_LN2;
+ /* Calculate n. */
+ n = x * M_1_LN2 + THREEp22;
+ n -= THREEp22;
+ dx = x - n*M_LN2;
- /* Calculate t/512. */
- t = dx + THREEp42;
- t -= THREEp42;
- dx -= t;
+ /* Calculate t/512. */
+ t = dx + THREEp42;
+ t -= THREEp42;
+ dx -= t;
- /* Compute tval = t. */
- tval = (int) (t * 512.0);
+ /* Compute tval = t. */
+ tval = (int) (t * 512.0);
- if (t >= 0)
- delta = - __exp_deltatable[tval];
- else
- delta = __exp_deltatable[-tval];
+ if (t >= 0)
+ delta = - __exp_deltatable[tval];
+ else
+ delta = __exp_deltatable[-tval];
- /* Compute ex2 = 2^n e^(t/512+delta[t]). */
- ex2_u.d = __exp_atable[tval+177];
- ex2_u.ieee.exponent += (int) n;
+ /* Compute ex2 = 2^n e^(t/512+delta[t]). */
+ ex2_u.d = __exp_atable[tval+177];
+ ex2_u.ieee.exponent += (int) n;
- /* Approximate e^(dx+delta) - 1, using a second-degree polynomial,
- with maximum error in [-2^-10-2^-28,2^-10+2^-28]
- less than 5e-11. */
- x22 = (0.5000000496709180453 * dx + 1.0000001192102037084) * dx + delta;
+ /* Approximate e^(dx+delta) - 1, using a second-degree polynomial,
+ with maximum error in [-2^-10-2^-28,2^-10+2^-28]
+ less than 5e-11. */
+ x22 = (0.5000000496709180453 * dx + 1.0000001192102037084) * dx + delta;
+ }
/* Return result. */
- libc_fesetenvf (&oldenv);
-
result = x22 * ex2_u.d + ex2_u.d;
return (float) result;
}
diff --git a/libc/sysdeps/ieee754/flt-32/e_hypotf.c b/libc/sysdeps/ieee754/flt-32/e_hypotf.c
index 97e7d34b6..8f499b5fd 100644
--- a/libc/sysdeps/ieee754/flt-32/e_hypotf.c
+++ b/libc/sysdeps/ieee754/flt-32/e_hypotf.c
@@ -19,62 +19,35 @@
float
__ieee754_hypotf(float x, float y)
{
- float a,b,t1,t2,y1,y2,w;
- int32_t j,k,ha,hb;
+ double d_x, d_y;
+ int32_t ha, hb;
GET_FLOAT_WORD(ha,x);
ha &= 0x7fffffff;
GET_FLOAT_WORD(hb,y);
hb &= 0x7fffffff;
- if(hb > ha) {a=y;b=x;j=ha; ha=hb;hb=j;} else {a=x;b=y;}
- SET_FLOAT_WORD(a,ha); /* a <- |a| */
- SET_FLOAT_WORD(b,hb); /* b <- |b| */
- if((ha-hb)>0xf000000) {return a+b;} /* x/y > 2**30 */
- k=0;
- if(__builtin_expect(ha > 0x58800000, 0)) { /* a>2**50 */
- if(ha >= 0x7f800000) { /* Inf or NaN */
- w = a+b; /* for sNaN */
- if(ha == 0x7f800000) w = a;
- if(hb == 0x7f800000) w = b;
- return w;
- }
- /* scale a and b by 2**-60 */
- ha -= 0x1e000000; hb -= 0x1e000000; k += 60;
- SET_FLOAT_WORD(a,ha);
- SET_FLOAT_WORD(b,hb);
- }
- if(__builtin_expect(hb < 0x26800000, 0)) { /* b < 2**-50 */
- if(hb <= 0x007fffff) { /* subnormal b or 0 */
- if(hb==0) return a;
- SET_FLOAT_WORD(t1,0x7e800000); /* t1=2^126 */
- b *= t1;
- a *= t1;
- k -= 126;
- } else { /* scale a and b by 2^60 */
- ha += 0x1e000000; /* a *= 2^60 */
- hb += 0x1e000000; /* b *= 2^60 */
- k -= 60;
- SET_FLOAT_WORD(a,ha);
- SET_FLOAT_WORD(b,hb);
- }
- }
- /* medium size a and b */
- w = a-b;
- if (w>b) {
- SET_FLOAT_WORD(t1,ha&0xfffff000);
- t2 = a-t1;
- w = __ieee754_sqrtf(t1*t1-(b*(-b)-t2*(a+t1)));
- } else {
- a = a+a;
- SET_FLOAT_WORD(y1,hb&0xfffff000);
- y2 = b - y1;
- SET_FLOAT_WORD(t1,ha+0x00800000);
- t2 = a - t1;
- w = __ieee754_sqrtf(t1*y1-(w*(-w)-(t1*y2+t2*b)));
- }
- if(k!=0) {
- SET_FLOAT_WORD(t1,0x3f800000+(k<<23));
- return t1*w;
- } else return w;
+ if (ha == 0x7f800000)
+ {
+ if (x == y)
+ return fabsf(y);
+ return fabsf(x);
+ }
+ else if (hb == 0x7f800000)
+ {
+ if (x == y)
+ return fabsf(x);
+ return fabsf(y);
+ }
+ else if (ha > 0x7f800000 || hb > 0x7f800000)
+ return fabsf(x) * fabsf(y);
+ else if (ha == 0)
+ return fabsf(y);
+ else if (hb == 0)
+ return fabsf(x);
+
+ d_x = (double) x;
+ d_y = (double) y;
+
+ return (float) __ieee754_sqrt(d_x * d_x + d_y * d_y);
}
strong_alias (__ieee754_hypotf, __hypotf_finite)
diff --git a/libc/sysdeps/ieee754/flt-32/math_private.h b/libc/sysdeps/ieee754/flt-32/math_private.h
new file mode 100644
index 000000000..e33db02b4
--- /dev/null
+++ b/libc/sysdeps/ieee754/flt-32/math_private.h
@@ -0,0 +1,35 @@
+#ifndef _MATH_PRIVATE_H_
+
+#include_next <math_private.h>
+
+#ifndef __isnanf
+extern __always_inline int
+__isnanf (float d)
+{
+ u_int32_t di;
+ GET_FLOAT_WORD (di, d);
+ return (di & 0x7fffffff) > 0x7f800000;
+}
+#endif
+
+#ifndef __isinf_nsf
+extern __always_inline int
+__isinf_nsf (float d)
+{
+ u_int32_t di;
+ GET_FLOAT_WORD (di, d);
+ return (di & 0x7fffffff) == 0x7f800000;
+}
+#endif
+
+#ifndef __finitef
+extern __always_inline int
+__finitef (float d)
+{
+ u_int32_t di;
+ GET_FLOAT_WORD (di, d);
+ return (di & 0x7fffffff) < 0x7f800000;
+}
+#endif
+
+#endif /* _MATH_PRIVATE_H_ */
diff --git a/libc/sysdeps/ieee754/ldbl-128/s_expm1l.c b/libc/sysdeps/ieee754/ldbl-128/s_expm1l.c
index 17769dd6a..ea6350181 100644
--- a/libc/sysdeps/ieee754/ldbl-128/s_expm1l.c
+++ b/libc/sysdeps/ieee754/ldbl-128/s_expm1l.c
@@ -102,6 +102,11 @@ __expm1l (long double x)
ix = u.parts32.w0;
sign = ix & 0x80000000;
ix &= 0x7fffffff;
+ if (!sign && ix >= 0x40060000)
+ {
+ /* If num is positive and exp >= 6 use plain exp. */
+ return __expl (x);
+ }
if (ix >= 0x7fff0000)
{
/* Infinity. */
diff --git a/libc/sysdeps/ieee754/ldbl-96/e_rem_pio2l.c b/libc/sysdeps/ieee754/ldbl-96/e_rem_pio2l.c
new file mode 100644
index 000000000..b72230962
--- /dev/null
+++ b/libc/sysdeps/ieee754/ldbl-96/e_rem_pio2l.c
@@ -0,0 +1,236 @@
+/* Extended-precision floating point argument reduction.
+ Copyright (C) 1999-2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Based on quad-precision code by Jakub Jelinek <jj@ultra.linux.cz>
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received 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>
+
+/* Table of constants for 2/pi, 5628 hexadecimal digits of 2/pi. */
+static const int32_t two_over_pi[] = {
+0xa2f983, 0x6e4e44, 0x1529fc, 0x2757d1, 0xf534dd, 0xc0db62,
+0x95993c, 0x439041, 0xfe5163, 0xabdebb, 0xc561b7, 0x246e3a,
+0x424dd2, 0xe00649, 0x2eea09, 0xd1921c, 0xfe1deb, 0x1cb129,
+0xa73ee8, 0x8235f5, 0x2ebb44, 0x84e99c, 0x7026b4, 0x5f7e41,
+0x3991d6, 0x398353, 0x39f49c, 0x845f8b, 0xbdf928, 0x3b1ff8,
+0x97ffde, 0x05980f, 0xef2f11, 0x8b5a0a, 0x6d1f6d, 0x367ecf,
+0x27cb09, 0xb74f46, 0x3f669e, 0x5fea2d, 0x7527ba, 0xc7ebe5,
+0xf17b3d, 0x0739f7, 0x8a5292, 0xea6bfb, 0x5fb11f, 0x8d5d08,
+0x560330, 0x46fc7b, 0x6babf0, 0xcfbc20, 0x9af436, 0x1da9e3,
+0x91615e, 0xe61b08, 0x659985, 0x5f14a0, 0x68408d, 0xffd880,
+0x4d7327, 0x310606, 0x1556ca, 0x73a8c9, 0x60e27b, 0xc08c6b,
+0x47c419, 0xc367cd, 0xdce809, 0x2a8359, 0xc4768b, 0x961ca6,
+0xddaf44, 0xd15719, 0x053ea5, 0xff0705, 0x3f7e33, 0xe832c2,
+0xde4f98, 0x327dbb, 0xc33d26, 0xef6b1e, 0x5ef89f, 0x3a1f35,
+0xcaf27f, 0x1d87f1, 0x21907c, 0x7c246a, 0xfa6ed5, 0x772d30,
+0x433b15, 0xc614b5, 0x9d19c3, 0xc2c4ad, 0x414d2c, 0x5d000c,
+0x467d86, 0x2d71e3, 0x9ac69b, 0x006233, 0x7cd2b4, 0x97a7b4,
+0xd55537, 0xf63ed7, 0x1810a3, 0xfc764d, 0x2a9d64, 0xabd770,
+0xf87c63, 0x57b07a, 0xe71517, 0x5649c0, 0xd9d63b, 0x3884a7,
+0xcb2324, 0x778ad6, 0x23545a, 0xb91f00, 0x1b0af1, 0xdfce19,
+0xff319f, 0x6a1e66, 0x615799, 0x47fbac, 0xd87f7e, 0xb76522,
+0x89e832, 0x60bfe6, 0xcdc4ef, 0x09366c, 0xd43f5d, 0xd7de16,
+0xde3b58, 0x929bde, 0x2822d2, 0xe88628, 0x4d58e2, 0x32cac6,
+0x16e308, 0xcb7de0, 0x50c017, 0xa71df3, 0x5be018, 0x34132e,
+0x621283, 0x014883, 0x5b8ef5, 0x7fb0ad, 0xf2e91e, 0x434a48,
+0xd36710, 0xd8ddaa, 0x425fae, 0xce616a, 0xa4280a, 0xb499d3,
+0xf2a606, 0x7f775c, 0x83c2a3, 0x883c61, 0x78738a, 0x5a8caf,
+0xbdd76f, 0x63a62d, 0xcbbff4, 0xef818d, 0x67c126, 0x45ca55,
+0x36d9ca, 0xd2a828, 0x8d61c2, 0x77c912, 0x142604, 0x9b4612,
+0xc459c4, 0x44c5c8, 0x91b24d, 0xf31700, 0xad43d4, 0xe54929,
+0x10d5fd, 0xfcbe00, 0xcc941e, 0xeece70, 0xf53e13, 0x80f1ec,
+0xc3e7b3, 0x28f8c7, 0x940593, 0x3e71c1, 0xb3092e, 0xf3450b,
+0x9c1288, 0x7b20ab, 0x9fb52e, 0xc29247, 0x2f327b, 0x6d550c,
+0x90a772, 0x1fe76b, 0x96cb31, 0x4a1679, 0xe27941, 0x89dff4,
+0x9794e8, 0x84e6e2, 0x973199, 0x6bed88, 0x365f5f, 0x0efdbb,
+0xb49a48, 0x6ca467, 0x427271, 0x325d8d, 0xb8159f, 0x09e5bc,
+0x25318d, 0x3974f7, 0x1c0530, 0x010c0d, 0x68084b, 0x58ee2c,
+0x90aa47, 0x02e774, 0x24d6bd, 0xa67df7, 0x72486e, 0xef169f,
+0xa6948e, 0xf691b4, 0x5153d1, 0xf20acf, 0x339820, 0x7e4bf5,
+0x6863b2, 0x5f3edd, 0x035d40, 0x7f8985, 0x295255, 0xc06437,
+0x10d86d, 0x324832, 0x754c5b, 0xd4714e, 0x6e5445, 0xc1090b,
+0x69f52a, 0xd56614, 0x9d0727, 0x50045d, 0xdb3bb4, 0xc576ea,
+0x17f987, 0x7d6b49, 0xba271d, 0x296996, 0xacccc6, 0x5414ad,
+0x6ae290, 0x89d988, 0x50722c, 0xbea404, 0x940777, 0x7030f3,
+0x27fc00, 0xa871ea, 0x49c266, 0x3de064, 0x83dd97, 0x973fa3,
+0xfd9443, 0x8c860d, 0xde4131, 0x9d3992, 0x8c70dd, 0xe7b717,
+0x3bdf08, 0x2b3715, 0xa0805c, 0x93805a, 0x921110, 0xd8e80f,
+0xaf806c, 0x4bffdb, 0x0f9038, 0x761859, 0x15a562, 0xbbcb61,
+0xb989c7, 0xbd4010, 0x04f2d2, 0x277549, 0xf6b6eb, 0xbb22db,
+0xaa140a, 0x2f2689, 0x768364, 0x333b09, 0x1a940e, 0xaa3a51,
+0xc2a31d, 0xaeedaf, 0x12265c, 0x4dc26d, 0x9c7a2d, 0x9756c0,
+0x833f03, 0xf6f009, 0x8c402b, 0x99316d, 0x07b439, 0x15200c,
+0x5bc3d8, 0xc492f5, 0x4badc6, 0xa5ca4e, 0xcd37a7, 0x36a9e6,
+0x9492ab, 0x6842dd, 0xde6319, 0xef8c76, 0x528b68, 0x37dbfc,
+0xaba1ae, 0x3115df, 0xa1ae00, 0xdafb0c, 0x664d64, 0xb705ed,
+0x306529, 0xbf5657, 0x3aff47, 0xb9f96a, 0xf3be75, 0xdf9328,
+0x3080ab, 0xf68c66, 0x15cb04, 0x0622fa, 0x1de4d9, 0xa4b33d,
+0x8f1b57, 0x09cd36, 0xe9424e, 0xa4be13, 0xb52333, 0x1aaaf0,
+0xa8654f, 0xa5c1d2, 0x0f3f0b, 0xcd785b, 0x76f923, 0x048b7b,
+0x721789, 0x53a6c6, 0xe26e6f, 0x00ebef, 0x584a9b, 0xb7dac4,
+0xba66aa, 0xcfcf76, 0x1d02d1, 0x2df1b1, 0xc1998c, 0x77adc3,
+0xda4886, 0xa05df7, 0xf480c6, 0x2ff0ac, 0x9aecdd, 0xbc5c3f,
+0x6dded0, 0x1fc790, 0xb6db2a, 0x3a25a3, 0x9aaf00, 0x9353ad,
+0x0457b6, 0xb42d29, 0x7e804b, 0xa707da, 0x0eaa76, 0xa1597b,
+0x2a1216, 0x2db7dc, 0xfde5fa, 0xfedb89, 0xfdbe89, 0x6c76e4,
+0xfca906, 0x70803e, 0x156e85, 0xff87fd, 0x073e28, 0x336761,
+0x86182a, 0xeabd4d, 0xafe7b3, 0x6e6d8f, 0x396795, 0x5bbf31,
+0x48d784, 0x16df30, 0x432dc7, 0x356125, 0xce70c9, 0xb8cb30,
+0xfd6cbf, 0xa200a4, 0xe46c05, 0xa0dd5a, 0x476f21, 0xd21262,
+0x845cb9, 0x496170, 0xe0566b, 0x015299, 0x375550, 0xb7d51e,
+0xc4f133, 0x5f6e13, 0xe4305d, 0xa92e85, 0xc3b21d, 0x3632a1,
+0xa4b708, 0xd4b1ea, 0x21f716, 0xe4698f, 0x77ff27, 0x80030c,
+0x2d408d, 0xa0cd4f, 0x99a520, 0xd3a2b3, 0x0a5d2f, 0x42f9b4,
+0xcbda11, 0xd0be7d, 0xc1db9b, 0xbd17ab, 0x81a2ca, 0x5c6a08,
+0x17552e, 0x550027, 0xf0147f, 0x8607e1, 0x640b14, 0x8d4196,
+0xdebe87, 0x2afdda, 0xb6256b, 0x34897b, 0xfef305, 0x9ebfb9,
+0x4f6a68, 0xa82a4a, 0x5ac44f, 0xbcf82d, 0x985ad7, 0x95c7f4,
+0x8d4d0d, 0xa63a20, 0x5f57a4, 0xb13f14, 0x953880, 0x0120cc,
+0x86dd71, 0xb6dec9, 0xf560bf, 0x11654d, 0x6b0701, 0xacb08c,
+0xd0c0b2, 0x485551, 0x0efb1e, 0xc37295, 0x3b06a3, 0x3540c0,
+0x7bdc06, 0xcc45e0, 0xfa294e, 0xc8cad6, 0x41f3e8, 0xde647c,
+0xd8649b, 0x31bed9, 0xc397a4, 0xd45877, 0xc5e369, 0x13daf0,
+0x3c3aba, 0x461846, 0x5f7555, 0xf5bdd2, 0xc6926e, 0x5d2eac,
+0xed440e, 0x423e1c, 0x87c461, 0xe9fd29, 0xf3d6e7, 0xca7c22,
+0x35916f, 0xc5e008, 0x8dd7ff, 0xe26a6e, 0xc6fdb0, 0xc10893,
+0x745d7c, 0xb2ad6b, 0x9d6ecd, 0x7b723e, 0x6a11c6, 0xa9cff7,
+0xdf7329, 0xbac9b5, 0x5100b7, 0x0db2e2, 0x24ba74, 0x607de5,
+0x8ad874, 0x2c150d, 0x0c1881, 0x94667e, 0x162901, 0x767a9f,
+0xbefdfd, 0xef4556, 0x367ed9, 0x13d9ec, 0xb9ba8b, 0xfc97c4,
+0x27a831, 0xc36ef1, 0x36c594, 0x56a8d8, 0xb5a8b4, 0x0ecccf,
+0x2d8912, 0x34576f, 0x89562c, 0xe3ce99, 0xb920d6, 0xaa5e6b,
+0x9c2a3e, 0xcc5f11, 0x4a0bfd, 0xfbf4e1, 0x6d3b8e, 0x2c86e2,
+0x84d4e9, 0xa9b4fc, 0xd1eeef, 0xc9352e, 0x61392f, 0x442138,
+0xc8d91b, 0x0afc81, 0x6a4afb, 0xd81c2f, 0x84b453, 0x8c994e,
+0xcc2254, 0xdc552a, 0xd6c6c0, 0x96190b, 0xb8701a, 0x649569,
+0x605a26, 0xee523f, 0x0f117f, 0x11b5f4, 0xf5cbfc, 0x2dbc34,
+0xeebc34, 0xcc5de8, 0x605edd, 0x9b8e67, 0xef3392, 0xb817c9,
+0x9b5861, 0xbc57e1, 0xc68351, 0x103ed8, 0x4871dd, 0xdd1c2d,
+0xa118af, 0x462c21, 0xd7f359, 0x987ad9, 0xc0549e, 0xfa864f,
+0xfc0656, 0xae79e5, 0x362289, 0x22ad38, 0xdc9367, 0xaae855,
+0x382682, 0x9be7ca, 0xa40d51, 0xb13399, 0x0ed7a9, 0x480569,
+0xf0b265, 0xa7887f, 0x974c88, 0x36d1f9, 0xb39221, 0x4a827b,
+0x21cf98, 0xdc9f40, 0x5547dc, 0x3a74e1, 0x42eb67, 0xdf9dfe,
+0x5fd45e, 0xa4677b, 0x7aacba, 0xa2f655, 0x23882b, 0x55ba41,
+0x086e59, 0x862a21, 0x834739, 0xe6e389, 0xd49ee5, 0x40fb49,
+0xe956ff, 0xca0f1c, 0x8a59c5, 0x2bfa94, 0xc5c1d3, 0xcfc50f,
+0xae5adb, 0x86c547, 0x624385, 0x3b8621, 0x94792c, 0x876110,
+0x7b4c2a, 0x1a2c80, 0x12bf43, 0x902688, 0x893c78, 0xe4c4a8,
+0x7bdbe5, 0xc23ac4, 0xeaf426, 0x8a67f7, 0xbf920d, 0x2ba365,
+0xb1933d, 0x0b7cbd, 0xdc51a4, 0x63dd27, 0xdde169, 0x19949a,
+0x9529a8, 0x28ce68, 0xb4ed09, 0x209f44, 0xca984e, 0x638270,
+0x237c7e, 0x32b90f, 0x8ef5a7, 0xe75614, 0x08f121, 0x2a9db5,
+0x4d7e6f, 0x5119a5, 0xabf9b5, 0xd6df82, 0x61dd96, 0x023616,
+0x9f3ac4, 0xa1a283, 0x6ded72, 0x7a8d39, 0xa9b882, 0x5c326b,
+0x5b2746, 0xed3400, 0x7700d2, 0x55f4fc, 0x4d5901, 0x8071e0,
+0xe13f89, 0xb295f3, 0x64a8f1, 0xaea74b, 0x38fc4c, 0xeab2bb,
+0x47270b, 0xabc3a7, 0x34ba60, 0x52dd34, 0xf8563a, 0xeb7e8a,
+0x31bb36, 0x5895b7, 0x47f7a9, 0x94c3aa, 0xd39225, 0x1e7f3e,
+0xd8974e, 0xbba94f, 0xd8ae01, 0xe661b4, 0x393d8e, 0xa523aa,
+0x33068e, 0x1633b5, 0x3bb188, 0x1d3a9d, 0x4013d0, 0xcc1be5,
+0xf862e7, 0x3bf28f, 0x39b5bf, 0x0bc235, 0x22747e, 0xa247c0,
+0xd52d1f, 0x19add3, 0x9094df, 0x9311d0, 0xb42b25, 0x496db2,
+0xe264b2, 0x5ef135, 0x3bc6a4, 0x1a4ad0, 0xaac92e, 0x64e886,
+0x573091, 0x982cfb, 0x311b1a, 0x08728b, 0xbdcee1, 0x60e142,
+0xeb641d, 0xd0bba3, 0xe559d4, 0x597b8c, 0x2a4483, 0xf332ba,
+0xf84867, 0x2c8d1b, 0x2fa9b0, 0x50f3dd, 0xf9f573, 0xdb61b4,
+0xfe233e, 0x6c41a6, 0xeea318, 0x775a26, 0xbc5e5c, 0xcea708,
+0x94dc57, 0xe20196, 0xf1e839, 0xbe4851, 0x5d2d2f, 0x4e9555,
+0xd96ec2, 0xe7d755, 0x6304e0, 0xc02e0e, 0xfc40a0, 0xbbf9b3,
+0x7125a7, 0x222dfb, 0xf619d8, 0x838c1c, 0x6619e6, 0xb20d55,
+0xbb5137, 0x79e809, 0xaf9149, 0x0d73de, 0x0b0da5, 0xce7f58,
+0xac1934, 0x724667, 0x7a1a13, 0x9e26bc, 0x4555e7, 0x585cb5,
+0x711d14, 0x486991, 0x480d60, 0x56adab, 0xd62f64, 0x96ee0c,
+0x212ff3, 0x5d6d88, 0xa67684, 0x95651e, 0xab9e0a, 0x4ddefe,
+0x571010, 0x836a39, 0xf8ea31, 0x9e381d, 0xeac8b1, 0xcac96b,
+0x37f21e, 0xd505e9, 0x984743, 0x9fc56c, 0x0331b7, 0x3b8bf8,
+0x86e56a, 0x8dc343, 0x6230e7, 0x93cfd5, 0x6a8f2d, 0x733005,
+0x1af021, 0xa09fcb, 0x7415a1, 0xd56b23, 0x6ff725, 0x2f4bc7,
+0xb8a591, 0x7fac59, 0x5c55de, 0x212c38, 0xb13296, 0x5cff50,
+0x366262, 0xfa7b16, 0xf4d9a6, 0x2acfe7, 0xf07403, 0xd4d604,
+0x6fd916, 0x31b1bf, 0xcbb450, 0x5bd7c8, 0x0ce194, 0x6bd643,
+0x4fd91c, 0xdf4543, 0x5f3453, 0xe2b5aa, 0xc9aec8, 0x131485,
+0xf9d2bf, 0xbadb9e, 0x76f5b9, 0xaf15cf, 0xca3182, 0x14b56d,
+0xe9fe4d, 0x50fc35, 0xf5aed5, 0xa2d0c1, 0xc96057, 0x192eb6,
+0xe91d92, 0x07d144, 0xaea3c6, 0x343566, 0x26d5b4, 0x3161e2,
+0x37f1a2, 0x209eff, 0x958e23, 0x493798, 0x35f4a6, 0x4bdc02,
+0xc2be13, 0xbe80a0, 0x0b72a3, 0x115c5f, 0x1e1bd1, 0x0db4d3,
+0x869e85, 0x96976b, 0x2ac91f, 0x8a26c2, 0x3070f0, 0x041412,
+0xfc9fa5, 0xf72a38, 0x9c6878, 0xe2aa76, 0x50cfe1, 0x559274,
+0x934e38, 0x0a92f7, 0x5533f0, 0xa63db4, 0x399971, 0xe2b755,
+0xa98a7c, 0x008f19, 0xac54d2, 0x2ea0b4, 0xf5f3e0, 0x60c849,
+0xffd269, 0xae52ce, 0x7a5fdd, 0xe9ce06, 0xfb0ae8, 0xa50cce,
+0xea9d3e, 0x3766dd, 0xb834f5, 0x0da090, 0x846f88, 0x4ae3d5,
+0x099a03, 0x2eae2d, 0xfcb40a, 0xfb9b33, 0xe281dd, 0x1b16ba,
+0xd8c0af, 0xd96b97, 0xb52dc9, 0x9c277f, 0x5951d5, 0x21ccd6,
+0xb6496b, 0x584562, 0xb3baf2, 0xa1a5c4, 0x7ca2cf, 0xa9b93d,
+0x7b7b89, 0x483d38,
+};
+
+int32_t
+__ieee754_rem_pio2l (long double x, long double *y)
+{
+ double tx[3], ty[3];
+ int32_t se, j0;
+ u_int32_t i0, i1;
+ int sx;
+ int n, exp;
+
+ GET_LDOUBLE_WORDS (se, i0, i1, x);
+ sx = (se >> 15) & 1;
+ j0 = (se & 0x7fff) - 0x3fff;
+
+ if (j0 < -1)
+ {
+ /* |x| < pi/4. */
+ y[0] = x;
+ y[1] = 0;
+ return 0;
+ }
+
+ if (j0 >= 0x8000)
+ {
+ /* x is infinite or NaN. */
+ y[0] = x - x;
+ y[1] = y[0];
+ return 0;
+ }
+
+ /* Split the 64 bits of the mantissa into three 24-bit integers
+ stored in a double array. */
+ exp = j0 - 23;
+ tx[0] = (double) (i0 >> 8);
+ tx[1] = (double) (((i0 << 16) | (i1 >> 16)) & 0xffffff);
+ tx[2] = (double) ((i1 << 8) & 0xffffff);
+
+ n = __kernel_rem_pio2 (tx, ty, exp, 3, 2, two_over_pi);
+
+ /* The result is now stored in two double values, we need to convert
+ it into two long double values. */
+ if (sx == 0)
+ {
+ y[0] = (long double) ty[0] + (long double) ty[1];
+ y[1] = ty[1] - (y[0] - ty[0]);
+ return n;
+ }
+ else
+ {
+ y[0] = -((long double) ty[0] + (long double) ty[1]);
+ y[1] = -ty[1] - (y[0] + ty[0]);
+ return -n;
+ }
+}
diff --git a/libc/sysdeps/ieee754/ldbl-96/k_cosl.c b/libc/sysdeps/ieee754/ldbl-96/k_cosl.c
new file mode 100644
index 000000000..9e8f33a28
--- /dev/null
+++ b/libc/sysdeps/ieee754/ldbl-96/k_cosl.c
@@ -0,0 +1,123 @@
+/* Extended-precision floating point cosine on <-pi/4,pi/4>.
+ Copyright (C) 1999-2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Based on quad-precision cosine by Jakub Jelinek <jj@ultra.linux.cz>
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received 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>
+
+/* The polynomials have not been optimized for extended-precision and
+ may contain more terms than needed. */
+
+static const long double c[] = {
+#define ONE c[0]
+ 1.00000000000000000000000000000000000E+00L,
+
+/* cos x ~ ONE + x^2 ( SCOS1 + SCOS2 * x^2 + ... + SCOS4 * x^6 + SCOS5 * x^8 )
+ x in <0,1/256> */
+#define SCOS1 c[1]
+#define SCOS2 c[2]
+#define SCOS3 c[3]
+#define SCOS4 c[4]
+#define SCOS5 c[5]
+-5.00000000000000000000000000000000000E-01L,
+ 4.16666666666666666666666666556146073E-02L,
+-1.38888888888888888888309442601939728E-03L,
+ 2.48015873015862382987049502531095061E-05L,
+-2.75573112601362126593516899592158083E-07L,
+
+/* cos x ~ ONE + x^2 ( COS1 + COS2 * x^2 + ... + COS7 * x^12 + COS8 * x^14 )
+ x in <0,0.1484375> */
+#define COS1 c[6]
+#define COS2 c[7]
+#define COS3 c[8]
+#define COS4 c[9]
+#define COS5 c[10]
+#define COS6 c[11]
+#define COS7 c[12]
+#define COS8 c[13]
+-4.99999999999999999999999999999999759E-01L,
+ 4.16666666666666666666666666651287795E-02L,
+-1.38888888888888888888888742314300284E-03L,
+ 2.48015873015873015867694002851118210E-05L,
+-2.75573192239858811636614709689300351E-07L,
+ 2.08767569877762248667431926878073669E-09L,
+-1.14707451049343817400420280514614892E-11L,
+ 4.77810092804389587579843296923533297E-14L,
+
+/* sin x ~ ONE * x + x^3 ( SSIN1 + SSIN2 * x^2 + ... + SSIN4 * x^6 + SSIN5 * x^8 )
+ x in <0,1/256> */
+#define SSIN1 c[14]
+#define SSIN2 c[15]
+#define SSIN3 c[16]
+#define SSIN4 c[17]
+#define SSIN5 c[18]
+-1.66666666666666666666666666666666659E-01L,
+ 8.33333333333333333333333333146298442E-03L,
+-1.98412698412698412697726277416810661E-04L,
+ 2.75573192239848624174178393552189149E-06L,
+-2.50521016467996193495359189395805639E-08L,
+};
+
+#define SINCOSL_COS_HI 0
+#define SINCOSL_COS_LO 1
+#define SINCOSL_SIN_HI 2
+#define SINCOSL_SIN_LO 3
+extern const long double __sincosl_table[];
+
+long double
+__kernel_cosl(long double x, long double y)
+{
+ long double h, l, z, sin_l, cos_l_m1;
+ int index;
+
+ if (signbit (x))
+ {
+ x = -x;
+ y = -y;
+ }
+ if (x < 0.1484375L)
+ {
+ /* Argument is small enough to approximate it by a Chebyshev
+ polynomial of degree 16. */
+ if (x < 0x1p-33L)
+ if (!((int)x)) return ONE; /* generate inexact */
+ z = x * x;
+ return ONE + (z*(COS1+z*(COS2+z*(COS3+z*(COS4+
+ z*(COS5+z*(COS6+z*(COS7+z*COS8))))))));
+ }
+ else
+ {
+ /* So that we don't have to use too large polynomial, we find
+ l and h such that x = l + h, where fabsl(l) <= 1.0/256 with 83
+ possible values for h. We look up cosl(h) and sinl(h) in
+ pre-computed tables, compute cosl(l) and sinl(l) using a
+ Chebyshev polynomial of degree 10(11) and compute
+ cosl(h+l) = cosl(h)cosl(l) - sinl(h)sinl(l). */
+ index = (int) (128 * (x - (0.1484375L - 1.0L / 256.0L)));
+ h = 0.1484375L + index / 128.0;
+ index *= 4;
+ l = y - (h - x);
+ z = l * l;
+ sin_l = l*(ONE+z*(SSIN1+z*(SSIN2+z*(SSIN3+z*(SSIN4+z*SSIN5)))));
+ cos_l_m1 = z*(SCOS1+z*(SCOS2+z*(SCOS3+z*(SCOS4+z*SCOS5))));
+ return __sincosl_table [index + SINCOSL_COS_HI]
+ + (__sincosl_table [index + SINCOSL_COS_LO]
+ - (__sincosl_table [index + SINCOSL_SIN_HI] * sin_l
+ - __sincosl_table [index + SINCOSL_COS_HI] * cos_l_m1));
+ }
+}
diff --git a/libc/sysdeps/ieee754/ldbl-96/k_sinl.c b/libc/sysdeps/ieee754/ldbl-96/k_sinl.c
new file mode 100644
index 000000000..feb24d9e7
--- /dev/null
+++ b/libc/sysdeps/ieee754/ldbl-96/k_sinl.c
@@ -0,0 +1,126 @@
+/* Quad-precision floating point sine on <-pi/4,pi/4>.
+ Copyright (C) 1999-2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Based on quad-precision sine by Jakub Jelinek <jj@ultra.linux.cz>
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+/* The polynomials have not been optimized for extended-precision and
+ may contain more terms than needed. */
+
+#include <math.h>
+#include <math_private.h>
+
+/* The polynomials have not been optimized for extended-precision and
+ may contain more terms than needed. */
+
+static const long double c[] = {
+#define ONE c[0]
+ 1.00000000000000000000000000000000000E+00L,
+
+/* cos x ~ ONE + x^2 ( SCOS1 + SCOS2 * x^2 + ... + SCOS4 * x^6 + SCOS5 * x^8 )
+ x in <0,1/256> */
+#define SCOS1 c[1]
+#define SCOS2 c[2]
+#define SCOS3 c[3]
+#define SCOS4 c[4]
+#define SCOS5 c[5]
+-5.00000000000000000000000000000000000E-01L,
+ 4.16666666666666666666666666556146073E-02L,
+-1.38888888888888888888309442601939728E-03L,
+ 2.48015873015862382987049502531095061E-05L,
+-2.75573112601362126593516899592158083E-07L,
+
+/* sin x ~ ONE * x + x^3 ( SIN1 + SIN2 * x^2 + ... + SIN7 * x^12 + SIN8 * x^14 )
+ x in <0,0.1484375> */
+#define SIN1 c[6]
+#define SIN2 c[7]
+#define SIN3 c[8]
+#define SIN4 c[9]
+#define SIN5 c[10]
+#define SIN6 c[11]
+#define SIN7 c[12]
+#define SIN8 c[13]
+-1.66666666666666666666666666666666538e-01L,
+ 8.33333333333333333333333333307532934e-03L,
+-1.98412698412698412698412534478712057e-04L,
+ 2.75573192239858906520896496653095890e-06L,
+-2.50521083854417116999224301266655662e-08L,
+ 1.60590438367608957516841576404938118e-10L,
+-7.64716343504264506714019494041582610e-13L,
+ 2.81068754939739570236322404393398135e-15L,
+
+/* sin x ~ ONE * x + x^3 ( SSIN1 + SSIN2 * x^2 + ... + SSIN4 * x^6 + SSIN5 * x^8 )
+ x in <0,1/256> */
+#define SSIN1 c[14]
+#define SSIN2 c[15]
+#define SSIN3 c[16]
+#define SSIN4 c[17]
+#define SSIN5 c[18]
+-1.66666666666666666666666666666666659E-01L,
+ 8.33333333333333333333333333146298442E-03L,
+-1.98412698412698412697726277416810661E-04L,
+ 2.75573192239848624174178393552189149E-06L,
+-2.50521016467996193495359189395805639E-08L,
+};
+
+#define SINCOSL_COS_HI 0
+#define SINCOSL_COS_LO 1
+#define SINCOSL_SIN_HI 2
+#define SINCOSL_SIN_LO 3
+extern const long double __sincosl_table[];
+
+long double
+__kernel_sinl(long double x, long double y, int iy)
+{
+ long double absx, h, l, z, sin_l, cos_l_m1;
+ int index;
+
+ absx = fabsl (x);
+ if (absx < 0.1484375L)
+ {
+ /* Argument is small enough to approximate it by a Chebyshev
+ polynomial of degree 17. */
+ if (absx < 0x1p-33L)
+ if (!((int)x)) return x; /* generate inexact */
+ z = x * x;
+ return x + (x * (z*(SIN1+z*(SIN2+z*(SIN3+z*(SIN4+
+ z*(SIN5+z*(SIN6+z*(SIN7+z*SIN8)))))))));
+ }
+ else
+ {
+ /* So that we don't have to use too large polynomial, we find
+ l and h such that x = l + h, where fabsl(l) <= 1.0/256 with 83
+ possible values for h. We look up cosl(h) and sinl(h) in
+ pre-computed tables, compute cosl(l) and sinl(l) using a
+ Chebyshev polynomial of degree 10(11) and compute
+ sinl(h+l) = sinl(h)cosl(l) + cosl(h)sinl(l). */
+ index = (int) (128 * (absx - (0.1484375L - 1.0L / 256.0L)));
+ h = 0.1484375L + index / 128.0;
+ index *= 4;
+ if (iy)
+ l = (x < 0 ? -y : y) - (h - absx);
+ else
+ l = absx - h;
+ z = l * l;
+ sin_l = l*(ONE+z*(SSIN1+z*(SSIN2+z*(SSIN3+z*(SSIN4+z*SSIN5)))));
+ cos_l_m1 = z*(SCOS1+z*(SCOS2+z*(SCOS3+z*(SCOS4+z*SCOS5))));
+ z = __sincosl_table [index + SINCOSL_SIN_HI]
+ + (__sincosl_table [index + SINCOSL_SIN_LO]
+ + (__sincosl_table [index + SINCOSL_SIN_HI] * cos_l_m1)
+ + (__sincosl_table [index + SINCOSL_COS_HI] * sin_l));
+ return (x < 0) ? -z : z;
+ }
+}
diff --git a/libc/sysdeps/ieee754/ldbl-96/k_tanl.c b/libc/sysdeps/ieee754/ldbl-96/k_tanl.c
new file mode 100644
index 000000000..31cd236aa
--- /dev/null
+++ b/libc/sysdeps/ieee754/ldbl-96/k_tanl.c
@@ -0,0 +1,137 @@
+/*
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunPro, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ */
+
+/*
+ Long double expansions are
+ Copyright (C) 2001 Stephen L. Moshier <moshier@na-net.ornl.gov>
+ and are incorporated herein by permission of the author. The author
+ reserves the right to distribute this material elsewhere under different
+ copying permissions. These modifications are distributed here under
+ the following terms:
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+/* __kernel_tanl( x, y, k )
+ * kernel tan function on [-pi/4, pi/4], pi/4 ~ 0.7854
+ * Input x is assumed to be bounded by ~pi/4 in magnitude.
+ * Input y is the tail of x.
+ * Input k indicates whether tan (if k=1) or
+ * -1/tan (if k= -1) is returned.
+ *
+ * Algorithm
+ * 1. Since tan(-x) = -tan(x), we need only to consider positive x.
+ * 2. if x < 2^-33, return x with inexact if x!=0.
+ * 3. tan(x) is approximated by a rational form x + x^3 / 3 + x^5 R(x^2)
+ * on [0,0.67433].
+ *
+ * Note: tan(x+y) = tan(x) + tan'(x)*y
+ * ~ tan(x) + (1+x*x)*y
+ * Therefore, for better accuracy in computing tan(x+y), let
+ * r = x^3 * R(x^2)
+ * then
+ * tan(x+y) = x + (x^3 / 3 + (x^2 *(r+y)+y))
+ *
+ * 4. For x in [0.67433,pi/4], let y = pi/4 - x, then
+ * tan(x) = tan(pi/4-y) = (1-tan(y))/(1+tan(y))
+ * = 1 - 2*(tan(y) - (tan(y)^2)/(1+tan(y)))
+ */
+
+#include <math.h>
+#include <math_private.h>
+static const long double
+ one = 1.0L,
+ pio4hi = 0xc.90fdaa22168c235p-4L,
+ pio4lo = -0x3.b399d747f23e32ecp-68L,
+
+ /* tan x = x + x^3 / 3 + x^5 T(x^2)/U(x^2)
+ 0 <= x <= 0.6743316650390625
+ Peak relative error 8.0e-36 */
+ TH = 3.333333333333333333333333333333333333333E-1L,
+ T0 = -1.813014711743583437742363284336855889393E7L,
+ T1 = 1.320767960008972224312740075083259247618E6L,
+ T2 = -2.626775478255838182468651821863299023956E4L,
+ T3 = 1.764573356488504935415411383687150199315E2L,
+ T4 = -3.333267763822178690794678978979803526092E-1L,
+
+ U0 = -1.359761033807687578306772463253710042010E8L,
+ U1 = 6.494370630656893175666729313065113194784E7L,
+ U2 = -4.180787672237927475505536849168729386782E6L,
+ U3 = 8.031643765106170040139966622980914621521E4L,
+ U4 = -5.323131271912475695157127875560667378597E2L;
+ /* 1.000000000000000000000000000000000000000E0 */
+
+
+long double
+__kernel_tanl (long double x, long double y, int iy)
+{
+ long double z, r, v, w, s;
+ long double absx = fabsl (x);
+ int sign;
+
+ if (absx < 0x1p-33)
+ {
+ if ((int) x == 0)
+ { /* generate inexact */
+ if (x == 0 && iy == -1)
+ return one / fabsl (x);
+ else
+ return (iy == 1) ? x : -one / x;
+ }
+ }
+ if (absx >= 0.6743316650390625L)
+ {
+ if (signbit (x))
+ {
+ x = -x;
+ y = -y;
+ sign = -1;
+ }
+ else
+ sign = 1;
+ z = pio4hi - x;
+ w = pio4lo - y;
+ x = z + w;
+ y = 0.0;
+ }
+ z = x * x;
+ r = T0 + z * (T1 + z * (T2 + z * (T3 + z * T4)));
+ v = U0 + z * (U1 + z * (U2 + z * (U3 + z * (U4 + z))));
+ r = r / v;
+
+ s = z * x;
+ r = y + z * (s * r + y);
+ r += TH * s;
+ w = x + r;
+ if (absx >= 0.6743316650390625L)
+ {
+ v = (long double) iy;
+ w = (v - 2.0 * (x - (w * w / (w + v) - r)));
+ if (sign < 0)
+ w = -w;
+ return w;
+ }
+ if (iy == 1)
+ return w;
+ else
+ return -1.0 / (x + r);
+}
diff --git a/libc/sysdeps/ieee754/ldbl-96/s_cosl.c b/libc/sysdeps/ieee754/ldbl-96/s_cosl.c
index 9d5606cfe..8b0b7d3cc 100644
--- a/libc/sysdeps/ieee754/ldbl-96/s_cosl.c
+++ b/libc/sysdeps/ieee754/ldbl-96/s_cosl.c
@@ -68,7 +68,7 @@ long double __cosl(long double x)
/* cos(Inf or NaN) is NaN */
else if (se==0x7fff) {
- if ((i0 | i1) == 0)
+ if (i1 == 0 && i0 == 0x80000000)
__set_errno (EDOM);
return x-x;
}
diff --git a/libc/sysdeps/ieee754/ldbl-96/s_sinl.c b/libc/sysdeps/ieee754/ldbl-96/s_sinl.c
index f15eb749b..11e189982 100644
--- a/libc/sysdeps/ieee754/ldbl-96/s_sinl.c
+++ b/libc/sysdeps/ieee754/ldbl-96/s_sinl.c
@@ -68,7 +68,7 @@ long double __sinl(long double x)
/* sin(Inf or NaN) is NaN */
else if (se==0x7fff) {
- if ((i0 | i1) == 0)
+ if (i1 == 0 && i0 == 0x80000000)
__set_errno (EDOM);
return x-x;
}
diff --git a/libc/sysdeps/ieee754/ldbl-96/s_tanl.c b/libc/sysdeps/ieee754/ldbl-96/s_tanl.c
index 3054601a5..3fbe4a8f6 100644
--- a/libc/sysdeps/ieee754/ldbl-96/s_tanl.c
+++ b/libc/sysdeps/ieee754/ldbl-96/s_tanl.c
@@ -48,23 +48,28 @@ static char rcsid[] = "$NetBSD: $";
* TRIG(x) returns trig(x) nearly rounded
*/
+#include <errno.h>
#include <math.h>
#include <math_private.h>
long double __tanl(long double x)
{
long double y[2],z=0.0;
- int32_t n, se;
+ int32_t n, se, i0, i1;
/* High word of x. */
- GET_LDOUBLE_EXP(se,x);
+ GET_LDOUBLE_WORDS(se,i0,i1,x);
/* |x| ~< pi/4 */
se &= 0x7fff;
if(se <= 0x3ffe) return __kernel_tanl(x,z,1);
/* tan(Inf or NaN) is NaN */
- else if (se==0x7fff) return x-x; /* NaN */
+ else if (se==0x7fff) {
+ if (i1 == 0 && i0 == 0x80000000)
+ __set_errno (EDOM);
+ return x-x;
+ }
/* argument reduction needed */
else {
diff --git a/libc/sysdeps/ieee754/ldbl-96/t_sincosl.c b/libc/sysdeps/ieee754/ldbl-96/t_sincosl.c
new file mode 100644
index 000000000..50dd84b94
--- /dev/null
+++ b/libc/sysdeps/ieee754/ldbl-96/t_sincosl.c
@@ -0,0 +1,483 @@
+/* Extended-precision floating point sine and cosine tables.
+ Copyright (C) 1999-2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Based on quad-precision tables by Jakub Jelinek <jj@ultra.linux.cz>
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+/* For 0.1484375 + n/128.0, n=0..82 this table contains
+ first 64 bits of cosine, then at least 64 additional
+ bits and the same for sine.
+ 0.1484375+82.0/128.0 is the smallest number among above defined numbers
+ larger than pi/4.
+ Computed using MPFR:
+
+ #include <stdio.h>
+ #include <mpfr.h>
+
+ int
+ main (void)
+ {
+ int j;
+ mpfr_t t, b, i, rs, rc, ts, tc, tsl, tcl;
+ mpfr_init2 (b, 64);
+ mpfr_init2 (i, 64);
+ mpfr_init2 (t, 64);
+ mpfr_set_str (b, "0.1484375", 0, MPFR_RNDN);
+ mpfr_set_str (i, "0x1p-7", 0, MPFR_RNDN);
+ mpfr_init2 (rs, 300);
+ mpfr_init2 (rc, 300);
+ mpfr_init2 (ts, 64);
+ mpfr_init2 (tc, 64);
+ mpfr_init2 (tsl, 64);
+ mpfr_init2 (tcl, 64);
+ for (j = 0; j <= 82; j++)
+ {
+ mpfr_mul_ui (t, i, j, MPFR_RNDN);
+ mpfr_add (t, t, b, MPFR_RNDN);
+ printf (" /" "* x = 0.1484375 + %d/128. *" "/\n", j);
+ mpfr_cos (rc, t, MPFR_RNDN);
+ mpfr_sin (rs, t, MPFR_RNDN);
+ mpfr_set (tc, rc, MPFR_RNDN);
+ mpfr_set (ts, rs, MPFR_RNDN);
+ mpfr_sub (tcl, rc, tc, MPFR_RNDN);
+ mpfr_sub (tsl, rs, ts, MPFR_RNDN);
+ mpfr_printf (" %.17RaL,\n", tc);
+ mpfr_printf (" %.17RaL,\n", tcl);
+ mpfr_printf (" %.17RaL,\n", ts);
+ mpfr_printf (" %.17RaL,\n", tsl);
+ }
+ return 0;
+ }
+
+*/
+
+const long double __sincosl_table[] = {
+ /* x = 0.1484375 + 0/128. */
+ 0xf.d2f5320e1b7902100p-4L,
+ -0x6.4b225d06708635580p-68L,
+ 0x2.5dc50bc95711d0d80p-4L,
+ 0x1.787d108fd438cf5a0p-68L,
+ /* x = 0.1484375 + 1/128. */
+ 0xf.ce1a053e621438b00p-4L,
+ 0x6.d60c76e8c45bf0a80p-68L,
+ 0x2.7d66258bacd96a400p-4L,
+ -0x1.4cca4c9a3782a6bc0p-68L,
+ /* x = 0.1484375 + 2/128. */
+ 0xf.c8ffa01ba68074100p-4L,
+ 0x7.e05962b0d9fdf2000p-68L,
+ 0x2.9cfd49b8be4f66540p-4L,
+ -0x1.89354fe340fbd96c0p-68L,
+ /* x = 0.1484375 + 3/128. */
+ 0xf.c3a6170f767ac7300p-4L,
+ 0x5.d63d99a9d439e1d80p-68L,
+ 0x2.bc89f9f424de54840p-4L,
+ 0x1.de7ce03b2514952c0p-68L,
+ /* x = 0.1484375 + 4/128. */
+ 0xf.be0d7f7fef11e7100p-4L,
+ -0x5.5bc47540b095ba800p-68L,
+ 0x2.dc0bb80b49a97ffc0p-4L,
+ -0xc.b1722e07246208500p-72L,
+ /* x = 0.1484375 + 5/128. */
+ 0xf.b835efcf670dd2d00p-4L,
+ -0x1.90186db968115ec20p-68L,
+ 0x2.fb8205f75e56a2b40p-4L,
+ 0x1.6a1c4792f85625880p-68L,
+ /* x = 0.1484375 + 6/128. */
+ 0xf.b21f7f5c156696b00p-4L,
+ 0xa.c1fe28ac5fd766700p-76L,
+ 0x3.1aec65df552876f80p-4L,
+ 0x2.ece9a235671324700p-72L,
+ /* x = 0.1484375 + 7/128. */
+ 0xf.abca467fb3cb8f200p-4L,
+ -0x2.f960fe2715cc521c0p-68L,
+ 0x3.3a4a5a19d86246700p-4L,
+ 0x1.0f602c44df4fa5140p-68L,
+ /* x = 0.1484375 + 8/128. */
+ 0xf.a5365e8f1d3ca2800p-4L,
+ -0x4.1e24a289519b26800p-68L,
+ 0x3.599b652f40ec999c0p-4L,
+ 0x1.f12a0a4c8561de160p-68L,
+ /* x = 0.1484375 + 9/128. */
+ 0xf.9e63e1d9e8b6f6f00p-4L,
+ 0x2.e296bae5b5ed9c100p-68L,
+ 0x3.78df09db8c332ce00p-4L,
+ 0xd.2b53d865582e45200p-72L,
+ /* x = 0.1484375 + 10/128. */
+ 0xf.9752eba9fff6b9900p-4L,
+ -0x7.bd415254fab56cd00p-68L,
+ 0x3.9814cb10513453cc0p-4L,
+ -0x6.84de43e3595cc8500p-72L,
+ /* x = 0.1484375 + 11/128. */
+ 0xf.90039843324f9b900p-4L,
+ 0x4.0416c1984b6cbed00p-68L,
+ 0x3.b73c2bf6b4b9f6680p-4L,
+ 0xe.f9499c81f0d965100p-72L,
+ /* x = 0.1484375 + 12/128. */
+ 0xf.887604e2c39dbb200p-4L,
+ 0xe.4ec5825059a78a000p-72L,
+ 0x3.d654aff15cb457a00p-4L,
+ 0xf.ca854698aba330400p-72L,
+ /* x = 0.1484375 + 13/128. */
+ 0xf.80aa4fbef750ba800p-4L,
+ -0x7.c2cc346a06b075c00p-68L,
+ 0x3.f55dda9e62aed7500p-4L,
+ 0x1.3bd7b8e6a3d1635e0p-68L,
+ /* x = 0.1484375 + 14/128. */
+ 0xf.78a098069792dab00p-4L,
+ -0x4.3611bda6e483a5980p-68L,
+ 0x4.14572fd94556e6480p-4L,
+ -0xc.29dfd8ec7722b8400p-72L,
+ /* x = 0.1484375 + 15/128. */
+ 0xf.7058fde0788dfc800p-4L,
+ 0x5.b8fe88789e4f42500p-72L,
+ 0x4.334033bcd90d66080p-4L,
+ -0x3.0a0c93e2b47bbae40p-68L,
+ /* x = 0.1484375 + 16/128. */
+ 0xf.67d3a26af7d07aa00p-4L,
+ 0x4.bd6d42af8c0068000p-68L,
+ 0x4.52186aa5377ab2080p-4L,
+ 0x3.bf2524f52e3a06a80p-68L,
+ /* x = 0.1484375 + 17/128. */
+ 0xf.5f10a7bb77d3dfa00p-4L,
+ 0xc.1da8b578427832800p-72L,
+ 0x4.70df5931ae1d94600p-4L,
+ 0x7.6fe0dcff47fe31b80p-72L,
+ /* x = 0.1484375 + 18/128. */
+ 0xf.561030ddd7a789600p-4L,
+ 0xe.a9f4a32c652155500p-72L,
+ 0x4.8f948446abcd6b100p-4L,
+ -0x8.0334eff185e4d9100p-72L,
+ /* x = 0.1484375 + 19/128. */
+ 0xf.4cd261d3e6c15bb00p-4L,
+ 0x3.69c8758630d2ac000p-68L,
+ 0x4.ae37710fad27c8a80p-4L,
+ 0x2.9c4cf96c03519b9c0p-68L,
+ /* x = 0.1484375 + 20/128. */
+ 0xf.43575f94d4f6b2700p-4L,
+ 0x2.f5fb76b14d2a64ac0p-68L,
+ 0x4.ccc7a50127e1de100p-4L,
+ -0x3.494bf3cfd39ae0840p-68L,
+ /* x = 0.1484375 + 21/128. */
+ 0xf.399f500c9e9fd3800p-4L,
+ -0x5.166a8d9c254778900p-68L,
+ 0x4.eb44a5da74f600200p-4L,
+ 0x7.aaa090f0734e28880p-72L,
+ /* x = 0.1484375 + 22/128. */
+ 0xf.2faa5a1b74e82fd00p-4L,
+ 0x6.1fa05f9177380e900p-68L,
+ 0x5.09adf9a7b9a5a0f80p-4L,
+ -0x1.c75705c59f5e66be0p-68L,
+ /* x = 0.1484375 + 23/128. */
+ 0xf.2578a595224dd2e00p-4L,
+ 0x6.bfa2eb2f99cc67500p-68L,
+ 0x5.280326c3cf4818200p-4L,
+ 0x3.ba6bb08eac82c2080p-68L,
+ /* x = 0.1484375 + 24/128. */
+ 0xf.1b0a5b406b526d900p-4L,
+ -0x7.93aa0152372f23380p-68L,
+ 0x5.4643b3da29de9b380p-4L,
+ -0x2.8eaa110f0ccd04c00p-68L,
+ /* x = 0.1484375 + 25/128. */
+ 0xf.105fa4d66b607a600p-4L,
+ 0x7.d44e0427252044380p-68L,
+ 0x5.646f27e8bd65cbe00p-4L,
+ 0x3.a5d61ff0657229100p-68L,
+ /* x = 0.1484375 + 26/128. */
+ 0xf.0578ad01ede708000p-4L,
+ -0x5.c63f6239467b50100p-68L,
+ 0x5.82850a41e1dd46c80p-4L,
+ -0x9.fd15dbb3244403200p-76L,
+ /* x = 0.1484375 + 27/128. */
+ 0xe.fa559f5ec3aec3a00p-4L,
+ 0x4.eb03319278a2d4200p-68L,
+ 0x5.a084e28e35fda2780p-4L,
+ -0x9.202444aace28b3100p-72L,
+ /* x = 0.1484375 + 28/128. */
+ 0xe.eef6a879146af0c00p-4L,
+ -0x6.46a15d15f53f2c200p-72L,
+ 0x5.be6e38ce809554280p-4L,
+ 0x3.c14ee9da0d3648400p-68L,
+ /* x = 0.1484375 + 29/128. */
+ 0xe.e35bf5ccac8905300p-4L,
+ -0x3.26e2248cb2c5b81c0p-68L,
+ 0x5.dc40955d9084f4880p-4L,
+ 0x2.94675a2498de5d840p-68L,
+ /* x = 0.1484375 + 30/128. */
+ 0xe.d785b5c44741b4500p-4L,
+ -0x6.c3a943462cc75eb00p-68L,
+ 0x5.f9fb80f21b5364a00p-4L,
+ -0x3.bcdabf5af1dd3ad00p-68L,
+ /* x = 0.1484375 + 31/128. */
+ 0xe.cb7417b8d4ee3ff00p-4L,
+ -0x3.c8545bf8c55b70e00p-68L,
+ 0x6.179e84a09a5258a80p-4L,
+ -0x3.f164a0531fc1ada00p-68L,
+ /* x = 0.1484375 + 32/128. */
+ 0xe.bf274bf0bda4f6200p-4L,
+ 0x4.47e56a09362679900p-68L,
+ 0x6.352929dd264bd4480p-4L,
+ 0x2.02ea766325d8aa8c0p-68L,
+ /* x = 0.1484375 + 33/128. */
+ 0xe.b29f839f201fd1400p-4L,
+ -0x4.6c8697d86e9587100p-68L,
+ 0x6.529afa7d51b129600p-4L,
+ 0x3.1ec197c0a840a11c0p-68L,
+ /* x = 0.1484375 + 34/128. */
+ 0xe.a5dcf0e30cf03e700p-4L,
+ -0x6.8910f4e13d9aea080p-68L,
+ 0x6.6ff380ba014410a00p-4L,
+ -0x1.c65cdf4f5c05a02a0p-68L,
+ /* x = 0.1484375 + 35/128. */
+ 0xe.98dfc6c6be031e600p-4L,
+ 0xd.d3089cbdd18a75b00p-72L,
+ 0x6.8d324731433279700p-4L,
+ 0x3.bc712bcc4ccddc480p-68L,
+ /* x = 0.1484375 + 36/128. */
+ 0xe.8ba8393eca7821b00p-4L,
+ -0x5.a9c27cb6e49efee80p-68L,
+ 0x6.aa56d8e8249db4e80p-4L,
+ 0x3.60a761fe3f9e559c0p-68L,
+ /* x = 0.1484375 + 37/128. */
+ 0xe.7e367d2956cfb1700p-4L,
+ -0x4.955ee1abe632ffa80p-68L,
+ 0x6.c760c14c8585a5200p-4L,
+ -0x2.42cb99f5193ad5380p-68L,
+ /* x = 0.1484375 + 38/128. */
+ 0xe.708ac84d4172a3e00p-4L,
+ 0x2.737662213429e1400p-68L,
+ 0x6.e44f8c36eb10a1c80p-4L,
+ -0xa.d2f6c3ff0b2b84600p-72L,
+ /* x = 0.1484375 + 39/128. */
+ 0xe.62a551594b970a700p-4L,
+ 0x7.0b15d41d4c0e48400p-68L,
+ 0x7.0122c5ec5028c8d00p-4L,
+ -0xc.c540b02cbf333c800p-76L,
+ /* x = 0.1484375 + 40/128. */
+ 0xe.54864fe33e8575d00p-4L,
+ -0x5.40a42f1a30e4e5780p-68L,
+ 0x7.1dd9fb1ff46778500p-4L,
+ 0x3.acb970a9f6729c700p-68L,
+ /* x = 0.1484375 + 41/128. */
+ 0xe.462dfc670d421ab00p-4L,
+ 0x3.d1a15901228f146c0p-68L,
+ 0x7.3a74b8f52947b6800p-4L,
+ 0x1.baf6928eb3fb02180p-68L,
+ /* x = 0.1484375 + 42/128. */
+ 0xe.379c9045f29d51800p-4L,
+ -0x3.b7f755b683dfa84c0p-68L,
+ 0x7.56f28d011d9852880p-4L,
+ 0x2.44a75fc29c779bd80p-68L,
+ /* x = 0.1484375 + 43/128. */
+ 0xe.28d245c58baef7200p-4L,
+ 0x2.25e232abc003c4380p-68L,
+ 0x7.7353054ca72690d80p-4L,
+ -0x3.391e8e0266194c600p-68L,
+ /* x = 0.1484375 + 44/128. */
+ 0xe.19cf580eeec046b00p-4L,
+ -0x5.ebdd058b7f8131080p-68L,
+ 0x7.8f95b0560a9a3bd80p-4L,
+ -0x1.2084267e23c739ee0p-68L,
+ /* x = 0.1484375 + 45/128. */
+ 0xe.0a94032dbea7cee00p-4L,
+ -0x4.222625d0505267a80p-68L,
+ 0x7.abba1d12c17bfa200p-4L,
+ -0x2.6d0f26c09f2126680p-68L,
+ /* x = 0.1484375 + 46/128. */
+ 0xd.fb20840f3a9b36f00p-4L,
+ 0x7.ae2c515342890b600p-68L,
+ 0x7.c7bfdaf13e5ed1700p-4L,
+ 0x2.12f8a7525bfb113c0p-68L,
+ /* x = 0.1484375 + 47/128. */
+ 0xd.eb7518814a7a93200p-4L,
+ -0x4.433773ef632be3b00p-68L,
+ 0x7.e3a679daaf25c6780p-4L,
+ -0x1.abd434bfd72f69be0p-68L,
+ /* x = 0.1484375 + 48/128. */
+ 0xd.db91ff31879917300p-4L,
+ -0x4.2dbad2f5c7760ae80p-68L,
+ 0x7.ff6d8a34bd5e8fa80p-4L,
+ -0x2.b368b7d24aea62100p-68L,
+ /* x = 0.1484375 + 49/128. */
+ 0xd.cb7777ac420705100p-4L,
+ 0x6.8f31e3eb780ce9c80p-68L,
+ 0x8.1b149ce34caa5a500p-4L,
+ -0x1.9af072f602b295580p-68L,
+ /* x = 0.1484375 + 50/128. */
+ 0xd.bb25c25b8260c1500p-4L,
+ -0x9.1843671366e48f400p-72L,
+ 0x8.369b434a372da7f00p-4L,
+ -0x4.a3758e01c931e1f80p-68L,
+ /* x = 0.1484375 + 51/128. */
+ 0xd.aa9d2086082706400p-4L,
+ -0x2.1ae3f617aa166cd00p-72L,
+ 0x8.52010f4f080052100p-4L,
+ 0x3.78bd8dd614753d080p-68L,
+ /* x = 0.1484375 + 52/128. */
+ 0xd.99ddd44e44a43d500p-4L,
+ -0x2.b5c5c126adfbef900p-68L,
+ 0x8.6d45935ab396cb500p-4L,
+ -0x1.bde17dd211ab0caa0p-68L,
+ /* x = 0.1484375 + 53/128. */
+ 0xd.88e820b1526311e00p-4L,
+ -0x2.a9e1043f3e565ac80p-68L,
+ 0x8.8868625b4e1dbb200p-4L,
+ 0x3.13310133022527200p-68L,
+ /* x = 0.1484375 + 54/128. */
+ 0xd.77bc4985e93a60800p-4L,
+ -0x3.6279746f944394400p-68L,
+ 0x8.a3690fc5bfc11c000p-4L,
+ -0x6.aca1d8c657aed0b80p-68L,
+ /* x = 0.1484375 + 55/128. */
+ 0xd.665a937b4ef2b1f00p-4L,
+ 0x6.d51bad6d988a44180p-68L,
+ 0x8.be472f9776d809b00p-4L,
+ -0xd.477e8edbc29c29900p-72L,
+ /* x = 0.1484375 + 56/128. */
+ 0xd.54c3441844897fd00p-4L,
+ -0x7.07ac0f9aa0e459680p-68L,
+ 0x8.d902565817ee78400p-4L,
+ -0x6.431c32ed7f9fee680p-68L,
+ /* x = 0.1484375 + 57/128. */
+ 0xd.42f6a1b9f0168ce00p-4L,
+ -0xf.ce3d09c3726cfb200p-72L,
+ 0x8.f39a191b2ba612300p-4L,
+ -0x5.c05b0be2a5c002c00p-68L,
+ /* x = 0.1484375 + 58/128. */
+ 0xd.30f4f392c357ab000p-4L,
+ 0x6.61c5fa8a7d9b26600p-68L,
+ 0x9.0e0e0d81ca6787900p-4L,
+ 0x6.cc92c8ea8c2815c00p-68L,
+ /* x = 0.1484375 + 59/128. */
+ 0xd.1ebe81a95ee752e00p-4L,
+ 0x4.8a26bcd32d6e92300p-68L,
+ 0x9.285dc9bc45dd9ea00p-4L,
+ 0x3.d02457bcce59c4180p-68L,
+ /* x = 0.1484375 + 60/128. */
+ 0xd.0c5394d7722281900p-4L,
+ 0x5.e25736c0357470800p-68L,
+ 0x9.4288e48bd0335fc00p-4L,
+ 0x4.1c4cbd2920497a900p-68L,
+ /* x = 0.1484375 + 61/128. */
+ 0xc.f9b476c897c25c600p-4L,
+ -0x4.018af22c0cf715080p-68L,
+ 0x9.5c8ef544210ec0c00p-4L,
+ -0x6.e3b642d55f617ae80p-68L,
+ /* x = 0.1484375 + 62/128. */
+ 0xc.e6e171f92f2e27f00p-4L,
+ 0x3.2225327ec440ddb00p-68L,
+ 0x9.766f93cd18413a700p-4L,
+ -0x5.503e303903d754480p-68L,
+ /* x = 0.1484375 + 63/128. */
+ 0xc.d3dad1b5328a2e400p-4L,
+ 0x5.9f993f4f510881a00p-68L,
+ 0x9.902a58a45e27bed00p-4L,
+ 0x6.8412b426b675ed500p-68L,
+ /* x = 0.1484375 + 64/128. */
+ 0xc.c0a0e21709883a400p-4L,
+ -0xf.f6ee1ee5f811c4300p-76L,
+ 0x9.a9bedcdf01b38da00p-4L,
+ -0x6.c0c287df87e21d700p-68L,
+ /* x = 0.1484375 + 65/128. */
+ 0xc.ad33f00658fe5e800p-4L,
+ 0x2.04bbc0f3a66a0e6c0p-68L,
+ 0x9.c32cba2b14156ef00p-4L,
+ 0x5.256c4f857991ca680p-72L,
+ /* x = 0.1484375 + 66/128. */
+ 0xc.99944936cf48c8900p-4L,
+ 0x1.1ff93fe64b3ddb7a0p-68L,
+ 0x9.dc738ad14204e6900p-4L,
+ -0x6.53a7d2f07a7d9a700p-68L,
+ /* x = 0.1484375 + 67/128. */
+ 0xc.85c23c26ed7b6f000p-4L,
+ 0x1.4ef546c4792968220p-68L,
+ 0x9.f592e9b66a9cf9000p-4L,
+ 0x6.a3c7aa3c101998480p-68L,
+ /* x = 0.1484375 + 68/128. */
+ 0xc.71be181ecd6875d00p-4L,
+ -0x1.d25a9ea5fc335df80p-68L,
+ 0xa.0e8a725d33c828c00p-4L,
+ 0x1.1fa50fd9e9a15ffe0p-68L,
+ /* x = 0.1484375 + 69/128. */
+ 0xc.5d882d2ee48030c00p-4L,
+ 0x7.c07d28e981e348080p-68L,
+ 0xa.2759c0e79c3558200p-4L,
+ 0x5.27c32b55f5405c180p-68L,
+ /* x = 0.1484375 + 70/128. */
+ 0xc.4920cc2ec38fb8900p-4L,
+ 0x1.b38827db08884fc60p-68L,
+ 0xa.400072188acf49d00p-4L,
+ -0x2.94e8c7da1fc7cb900p-68L,
+ /* x = 0.1484375 + 71/128. */
+ 0xc.348846bbd36313400p-4L,
+ -0x7.001d401622ec7e600p-68L,
+ 0xa.587e23555bb080800p-4L,
+ 0x6.d02b9c662cdd29300p-68L,
+ /* x = 0.1484375 + 72/128. */
+ 0xc.1fbeef380e4ffdd00p-4L,
+ 0x5.a613ec8722f644000p-68L,
+ 0xa.70d272a76a8d4b700p-4L,
+ -0x2.5f136f8ed448b7480p-68L,
+ /* x = 0.1484375 + 73/128. */
+ 0xc.0ac518c8b6ae71100p-4L,
+ -0x4.5c85c1146f34ea500p-68L,
+ 0xa.88fcfebd9a8dd4800p-4L,
+ -0x1.d0c3891061dbc66e0p-68L,
+ /* x = 0.1484375 + 74/128. */
+ 0xb.f59b17550a4406800p-4L,
+ 0x7.5969296567cf3e380p-68L,
+ 0xa.a0fd66eddb9212300p-4L,
+ 0x2.c28520d3911b8a040p-68L,
+ /* x = 0.1484375 + 75/128. */
+ 0xb.e0413f84f2a771c00p-4L,
+ 0x6.14946a88cbf4da200p-68L,
+ 0xa.b8d34b36acd987200p-4L,
+ 0x1.0ed343ec65d7e3ae0p-68L,
+ /* x = 0.1484375 + 76/128. */
+ 0xb.cab7e6bfb2a14aa00p-4L,
+ -0x4.edd3a8b5c89413680p-68L,
+ 0xa.d07e4c409d08c5000p-4L,
+ -0x5.c56fa844f53db4780p-68L,
+ /* x = 0.1484375 + 77/128. */
+ 0xb.b4ff632a908f73f00p-4L,
+ -0x3.eae7c6346266c4b00p-68L,
+ 0xa.e7fe0b5fc786b2e00p-4L,
+ -0x6.991e2950ebf5b7780p-68L,
+ /* x = 0.1484375 + 78/128. */
+ 0xb.9f180ba77dd075100p-4L,
+ 0x6.28e135a9508299000p-68L,
+ 0xa.ff522a954f2ba1700p-4L,
+ -0x2.621023be91cc0a180p-68L,
+ /* x = 0.1484375 + 79/128. */
+ 0xb.890237d3bb3c28500p-4L,
+ -0x4.9eb5fac6fe9405f00p-68L,
+ 0xb.167a4c90d63c42400p-4L,
+ 0x4.cf5493b7cc23bd400p-68L,
+ /* x = 0.1484375 + 80/128. */
+ 0xb.72be40067aaf2c000p-4L,
+ 0x5.0dbdb7a14c3d7d500p-68L,
+ 0xb.2d7614b1f3aaa2500p-4L,
+ -0x2.0d291df5881e35c00p-68L,
+ /* x = 0.1484375 + 81/128. */
+ 0xb.5c4c7d4f7dae91600p-4L,
+ -0x5.3879330b4e5b67300p-68L,
+ 0xb.44452709a59752900p-4L,
+ 0x5.913765434a59d1100p-72L,
+ /* x = 0.1484375 + 82/128. */
+ 0xb.45ad4975b1294cb00p-4L,
+ -0x2.35b30bf1370dd5980p-68L,
+ 0xb.5ae7285bc10cf5100p-4L,
+ 0x5.753847e8f8b7a3100p-68L,
+};
diff --git a/libc/sysdeps/mach/_strerror.c b/libc/sysdeps/mach/_strerror.c
index 3c0928825..e3a5c8e3c 100644
--- a/libc/sysdeps/mach/_strerror.c
+++ b/libc/sysdeps/mach/_strerror.c
@@ -21,7 +21,7 @@
#include <mach/error.h>
#include <errorlib.h>
#include <sys/param.h>
-#include <stdio-common/_itoa.h>
+#include <_itoa.h>
/* It is critical here that we always use the `dcgettext' function for
the message translation. Since <libintl.h> only defines the macro
diff --git a/libc/sysdeps/mach/hurd/powerpc/register-dump.h b/libc/sysdeps/mach/hurd/powerpc/register-dump.h
index 258579727..80d545e48 100644
--- a/libc/sysdeps/mach/hurd/powerpc/register-dump.h
+++ b/libc/sysdeps/mach/hurd/powerpc/register-dump.h
@@ -17,7 +17,7 @@
<http://www.gnu.org/licenses/>. */
#include <sys/uio.h>
-#include <stdio-common/_itoa.h>
+#include <_itoa.h>
/* This prints out the information in the following form: */
static const char dumpform[] = "\
diff --git a/libc/sysdeps/mach/hurd/sethostid.c b/libc/sysdeps/mach/hurd/sethostid.c
index d1ff1b0f5..7fadf6aa8 100644
--- a/libc/sysdeps/mach/hurd/sethostid.c
+++ b/libc/sysdeps/mach/hurd/sethostid.c
@@ -18,7 +18,7 @@
#include <unistd.h>
#include <hurd.h>
#include "hurdhost.h"
-#include <stdio-common/_itoa.h>
+#include <_itoa.h>
/* Set the current machine's Internet number to ID.
This call is restricted to the super-user. */
diff --git a/libc/sysdeps/mach/hurd/xmknodat.c b/libc/sysdeps/mach/hurd/xmknodat.c
index a37b91882..acd1a8c68 100644
--- a/libc/sysdeps/mach/hurd/xmknodat.c
+++ b/libc/sysdeps/mach/hurd/xmknodat.c
@@ -23,7 +23,7 @@
#include <hurd/fd.h>
#include <hurd/paths.h>
#include <fcntl.h>
-#include "stdio-common/_itoa.h"
+#include <_itoa.h>
#include <string.h>
#include <sys/types.h>
diff --git a/libc/sysdeps/mach/xpg-strerror.c b/libc/sysdeps/mach/xpg-strerror.c
index 997c5b6a3..421d75803 100644
--- a/libc/sysdeps/mach/xpg-strerror.c
+++ b/libc/sysdeps/mach/xpg-strerror.c
@@ -23,7 +23,7 @@
#include <mach/error.h>
#include <errorlib.h>
#include <sys/param.h>
-#include <stdio-common/_itoa.h>
+#include <_itoa.h>
/* It is critical here that we always use the `dcgettext' function for
the message translation. Since <libintl.h> only defines the macro
diff --git a/libc/sysdeps/powerpc/fpu/e_hypotf.c b/libc/sysdeps/powerpc/fpu/e_hypotf.c
index 3838f53d8..92e824daf 100644
--- a/libc/sysdeps/powerpc/fpu/e_hypotf.c
+++ b/libc/sysdeps/powerpc/fpu/e_hypotf.c
@@ -1,5 +1,5 @@
/* Pythagorean addition using floats
- Copyright (C) 2011 Free Software Foundation, Inc.
+ Copyright (C) 2011, 2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Adhemerval Zanella <azanella@br.ibm.com>, 2011
@@ -22,21 +22,13 @@
static const float two30 = 1.0737418e09;
-static const float two50 = 1.1259000e15;
-static const float two60 = 1.1529221e18;
-static const float two126 = 8.5070592e+37;
-static const float twoM50 = 8.8817842e-16;
-static const float twoM60 = 6.7762644e-21;
-static const float pdnum = 1.1754939e-38;
-
/* __ieee754_hypotf(x,y)
- *
- * This a FP only version without any FP->INT conversion.
- * It is similar to default C version, making appropriates
- * overflow and underflows checks as well scaling when it
- * is needed.
- */
+
+ This a FP only version without any FP->INT conversion.
+ It is similar to default C version, making appropriates
+ overflow and underflows checks as using double precision
+ instead of scaling. */
#ifdef _ARCH_PWR7
/* POWER7 isinf and isnan optimizations are fast. */
@@ -92,27 +84,7 @@ __ieee754_hypotf (float x, float y)
{
return x + y;
}
- if (x > two50)
- {
- x *= twoM60;
- y *= twoM60;
- return __ieee754_sqrtf (x * x + y * y) / twoM60;
- }
- if (y < twoM50)
- {
- if (y <= pdnum)
- {
- x *= two126;
- y *= two126;
- return __ieee754_sqrtf (x * x + y * y) / two126;
- }
- else
- {
- x *= two60;
- y *= two60;
- return __ieee754_sqrtf (x * x + y * y) / two60;
- }
- }
- return __ieee754_sqrtf (x * x + y * y);
+
+ return __ieee754_sqrt ((double) x * x + (double) y * y);
}
strong_alias (__ieee754_hypotf, __hypotf_finite)
diff --git a/libc/sysdeps/powerpc/fpu/libm-test-ulps b/libc/sysdeps/powerpc/fpu/libm-test-ulps
index f3d4dd994..4b1cff076 100644
--- a/libc/sysdeps/powerpc/fpu/libm-test-ulps
+++ b/libc/sysdeps/powerpc/fpu/libm-test-ulps
@@ -53,7 +53,151 @@ Test "cabs (0.75 + 12.390625 i) == 12.4133028598606664302388810868156657":
float: 1
ifloat: 1
+# cacos
+Test "Imaginary part of: cacos (+0 + 0.5 i) == pi/2 - 0.4812118250596034474977589134243684231352 i":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 2
+ldouble: 2
+Test "Imaginary part of: cacos (+0 + 1.0 i) == pi/2 - 0.8813735870195430252326093249797923090282 i":
+double: 3
+float: 1
+idouble: 3
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacos (+0 + 1.5 i) == pi/2 - 1.194763217287109304111930828519090523536 i":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacos (+0 - 0.5 i) == pi/2 + 0.4812118250596034474977589134243684231352 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: cacos (+0 - 1.0 i) == pi/2 + 0.8813735870195430252326093249797923090282 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Imaginary part of: cacos (+0 - 1.5 i) == pi/2 + 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: cacos (-0 + 0.5 i) == pi/2 - 0.4812118250596034474977589134243684231352 i":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 2
+ldouble: 2
+Test "Imaginary part of: cacos (-0 + 1.0 i) == pi/2 - 0.8813735870195430252326093249797923090282 i":
+double: 3
+float: 1
+idouble: 3
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacos (-0 + 1.5 i) == pi/2 - 1.194763217287109304111930828519090523536 i":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacos (-0 - 0.5 i) == pi/2 + 0.4812118250596034474977589134243684231352 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: cacos (-0 - 1.0 i) == pi/2 + 0.8813735870195430252326093249797923090282 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Imaginary part of: cacos (-0 - 1.5 i) == pi/2 + 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
+Test "Real part of: cacos (-0.5 + +0 i) == 2.094395102393195492308428922186335256131 - 0 i":
+double: 1
+idouble: 1
+Test "Real part of: cacos (-0.5 - 0 i) == 2.094395102393195492308428922186335256131 + +0 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: cacos (-1.5 + +0 i) == pi - 0.9624236501192068949955178268487368462704 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Real part of: cacos (0.5 + +0 i) == 1.047197551196597746154214461093167628066 - 0 i":
+double: 1
+idouble: 1
+Test "Real part of: cacos (0.5 - 0 i) == 1.047197551196597746154214461093167628066 + +0 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: cacos (1.5 + +0 i) == +0 - 0.9624236501192068949955178268487368462704 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
# cacosh
+Test "Real part of: cacosh (+0 + 0.5 i) == 0.4812118250596034474977589134243684231352 + pi/2 i":
+float: 1
+ifloat: 1
+Test "Real part of: cacosh (+0 + 1.0 i) == 0.8813735870195430252326093249797923090282 + pi/2 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Real part of: cacosh (+0 + 1.5 i) == 1.194763217287109304111930828519090523536 + pi/2 i":
+double: 1
+idouble: 1
+Test "Real part of: cacosh (+0 - 0.5 i) == 0.4812118250596034474977589134243684231352 - pi/2 i":
+float: 1
+ifloat: 1
+Test "Real part of: cacosh (+0 - 1.0 i) == 0.8813735870195430252326093249797923090282 - pi/2 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Real part of: cacosh (+0 - 1.5 i) == 1.194763217287109304111930828519090523536 - pi/2 i":
+double: 1
+idouble: 1
+Test "Real part of: cacosh (-0 + 0.5 i) == 0.4812118250596034474977589134243684231352 + pi/2 i":
+float: 1
+ifloat: 1
+Test "Real part of: cacosh (-0 + 1.0 i) == 0.8813735870195430252326093249797923090282 + pi/2 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Real part of: cacosh (-0 + 1.5 i) == 1.194763217287109304111930828519090523536 + pi/2 i":
+double: 1
+idouble: 1
+Test "Real part of: cacosh (-0 - 0.5 i) == 0.4812118250596034474977589134243684231352 - pi/2 i":
+float: 1
+ifloat: 1
+Test "Real part of: cacosh (-0 - 1.0 i) == 0.8813735870195430252326093249797923090282 - pi/2 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Real part of: cacosh (-0 - 1.5 i) == 1.194763217287109304111930828519090523536 - pi/2 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: cacosh (-0.5 + +0 i) == +0 + 2.094395102393195492308428922186335256131 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: cacosh (-0.5 - 0 i) == +0 - 2.094395102393195492308428922186335256131 i":
+double: 1
+idouble: 1
+Test "Real part of: cacosh (-1.5 + +0 i) == 0.9624236501192068949955178268487368462704 + pi i":
+float: 1
+ifloat: 1
+Test "Real part of: cacosh (-1.5 - 0 i) == 0.9624236501192068949955178268487368462704 - pi i":
+float: 1
+ifloat: 1
Test "Real part of: cacosh (-2 - 3 i) == 1.9833870299165354323470769028940395 - 2.1414491111159960199416055713254211 i":
double: 1
float: 7
@@ -64,18 +208,200 @@ double: 1
float: 3
idouble: 1
ifloat: 3
+Test "Imaginary part of: cacosh (0.5 + +0 i) == +0 + 1.047197551196597746154214461093167628066 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacosh (0.5 - 0 i) == +0 - 1.047197551196597746154214461093167628066 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: cacosh (1.5 + +0 i) == 0.9624236501192068949955178268487368462704 + +0 i":
+float: 1
+ifloat: 1
+Test "Real part of: cacosh (1.5 - 0 i) == 0.9624236501192068949955178268487368462704 - 0 i":
+float: 1
+ifloat: 1
# casin
+Test "Imaginary part of: casin (+0 + 0.5 i) == +0 + 0.4812118250596034474977589134243684231352 i":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 2
+ldouble: 2
+Test "Imaginary part of: casin (+0 + 1.0 i) == +0 + 0.8813735870195430252326093249797923090282 i":
+double: 3
+float: 1
+idouble: 3
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (+0 + 1.5 i) == +0 + 1.194763217287109304111930828519090523536 i":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (+0 - 0.5 i) == +0 - 0.4812118250596034474977589134243684231352 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: casin (+0 - 1.0 i) == +0 - 0.8813735870195430252326093249797923090282 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Imaginary part of: casin (+0 - 1.5 i) == +0 - 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: casin (-0 + 0.5 i) == -0 + 0.4812118250596034474977589134243684231352 i":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 2
+ldouble: 2
+Test "Imaginary part of: casin (-0 + 1.0 i) == -0 + 0.8813735870195430252326093249797923090282 i":
+double: 3
+float: 1
+idouble: 3
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (-0 + 1.5 i) == -0 + 1.194763217287109304111930828519090523536 i":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (-0 - 0.5 i) == -0 - 0.4812118250596034474977589134243684231352 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: casin (-0 - 1.0 i) == -0 - 0.8813735870195430252326093249797923090282 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Imaginary part of: casin (-0 - 1.5 i) == -0 - 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
+Test "Real part of: casin (-0.5 + +0 i) == -0.5235987755982988730771072305465838140329 + +0 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: casin (-0.5 - 0 i) == -0.5235987755982988730771072305465838140329 - 0 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (-1.5 + +0 i) == -pi/2 + 0.9624236501192068949955178268487368462704 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
Test "Real part of: casin (-2 - 3 i) == -0.57065278432109940071028387968566963 - 1.9833870299165354323470769028940395 i":
ildouble: 1
ldouble: 1
+Test "Real part of: casin (0.5 + +0 i) == 0.5235987755982988730771072305465838140329 + +0 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: casin (0.5 - 0 i) == 0.5235987755982988730771072305465838140329 - 0 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
Test "Real part of: casin (0.75 + 1.25 i) == 0.453276177638793913448921196101971749 + 1.13239363160530819522266333696834467 i":
double: 1
float: 1
idouble: 1
ifloat: 1
+Test "Imaginary part of: casin (1.5 + +0 i) == pi/2 + 0.9624236501192068949955178268487368462704 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
# casinh
+Test "Imaginary part of: casinh (+0 + 0.5 i) == +0 + 0.5235987755982988730771072305465838140329 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casinh (+0 - 0.5 i) == +0 - 0.5235987755982988730771072305465838140329 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casinh (-0 + 0.5 i) == -0 + 0.5235987755982988730771072305465838140329 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: casinh (-0 + 1.5 i) == -0.9624236501192068949955178268487368462704 + pi/2 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Imaginary part of: casinh (-0 - 0.5 i) == -0 - 0.5235987755982988730771072305465838140329 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: casinh (-0 - 1.5 i) == -0.9624236501192068949955178268487368462704 - pi/2 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Real part of: casinh (-0.5 + +0 i) == -0.4812118250596034474977589134243684231352 + +0 i":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 2
+ldouble: 2
+Test "Real part of: casinh (-0.5 - 0 i) == -0.4812118250596034474977589134243684231352 - 0 i":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 2
+ldouble: 2
+Test "Real part of: casinh (-1.0 + +0 i) == -0.8813735870195430252326093249797923090282 + +0 i":
+double: 3
+float: 1
+idouble: 3
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: casinh (-1.0 - 0 i) == -0.8813735870195430252326093249797923090282 - 0 i":
+double: 3
+float: 1
+idouble: 3
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: casinh (-1.5 + +0 i) == -1.194763217287109304111930828519090523536 + +0 i":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: casinh (-1.5 - 0 i) == -1.194763217287109304111930828519090523536 - 0 i":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 1
+ldouble: 1
Test "Real part of: casinh (-2 - 3 i) == -1.9686379257930962917886650952454982 - 0.96465850440760279204541105949953237 i":
double: 5
float: 1
@@ -90,6 +416,12 @@ idouble: 3
ifloat: 6
ildouble: 1
ldouble: 1
+Test "Real part of: casinh (0.5 + +0 i) == 0.4812118250596034474977589134243684231352 + +0 i":
+float: 1
+ifloat: 1
+Test "Real part of: casinh (0.5 - 0 i) == 0.4812118250596034474977589134243684231352 - 0 i":
+float: 1
+ifloat: 1
Test "Real part of: casinh (0.75 + 1.25 i) == 1.03171853444778027336364058631006594 + 0.911738290968487636358489564316731207 i":
float: 1
ifloat: 1
@@ -98,6 +430,22 @@ double: 1
float: 1
idouble: 1
ifloat: 1
+Test "Real part of: casinh (1.0 + +0 i) == 0.8813735870195430252326093249797923090282 + +0 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Real part of: casinh (1.0 - 0 i) == 0.8813735870195430252326093249797923090282 - 0 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Real part of: casinh (1.5 + +0 i) == 1.194763217287109304111930828519090523536 + +0 i":
+double: 1
+idouble: 1
+Test "Real part of: casinh (1.5 - 0 i) == 1.194763217287109304111930828519090523536 - 0 i":
+double: 1
+idouble: 1
# catan
Test "Real part of: catan (-2 - 3 i) == -1.4099210495965755225306193844604208 - 0.22907268296853876629588180294200276 i":
@@ -570,6 +918,42 @@ idouble: 1
Test "Imaginary part of: csqrt (0 - 1 i) == M_SQRT_2_2 - M_SQRT_2_2 i":
double: 1
idouble: 1
+Test "Imaginary part of: csqrt (0x1.fffffep+127 + 1.0 i) == 1.844674352395372953599975585936590505260e+19 + 2.710505511993121390769065968615872097053e-20 i":
+float: 1
+ifloat: 1
+Test "Real part of: csqrt (0x1.fffffffffffffp+1023 + 0x1.fffffffffffffp+1023 i) == 1.473094556905565378990473658199034571917e+154 + 6.101757441282702188537080005372547713595e+153 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: csqrt (0x1.fffffffffffffp+1023 + 0x1.fffffffffffffp+1023 i) == 1.473094556905565378990473658199034571917e+154 + 6.101757441282702188537080005372547713595e+153 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: csqrt (0x1.fffffffffffffp+1023 + 0x1p+1023 i) == 1.379778091031440685006200821918878702861e+154 + 3.257214233483129514781233066898042490248e+153 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: csqrt (0x1p-1073 + 0x1p-1073 i) == 3.453664695497464982856905711457966660085e-162 + 1.430554756764195530630723976279903095110e-162 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: csqrt (0x1p-1073 + 0x1p-1073 i) == 3.453664695497464982856905711457966660085e-162 + 1.430554756764195530630723976279903095110e-162 i":
+double: 1
+idouble: 1
+Test "Real part of: csqrt (0x1p-147 + 0x1p-147 i) == 8.225610928685557596194006925540350401606e-23 + 3.407159605465907500737319471202779419102e-23 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: csqrt (0x1p-147 + 0x1p-147 i) == 8.225610928685557596194006925540350401606e-23 + 3.407159605465907500737319471202779419102e-23 i":
+double: 1
+idouble: 1
+Test "Real part of: csqrt (0x1p-149 + 0x1p-149 i) == 4.112805464342778798097003462770175200803e-23 + 1.703579802732953750368659735601389709551e-23 i":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+Test "Imaginary part of: csqrt (0x1p-149 + 0x1p-149 i) == 4.112805464342778798097003462770175200803e-23 + 1.703579802732953750368659735601389709551e-23 i":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
# ctan
Test "Real part of: ctan (-2 - 3 i) == 0.376402564150424829275122113032269084e-2 - 1.00323862735360980144635859782192726 i":
@@ -733,6 +1117,9 @@ float: 1
ifloat: 1
ildouble: 1
ldouble: 1
+Test "hypot (0x1.234566p-126, 0x1.234566p-126) == 1.891441686191081936598531534017449451173e-38":
+double: 1
+idouble: 1
Test "hypot (12.4, -0.7) == 12.419742348374220601176836866763271":
double: 1
float: 1
@@ -745,6 +1132,9 @@ idouble: 1
ifloat: 1
# j0
+Test "j0 (-0x1.001000001p+593) == -3.927269966354206207832593635798954916263e-90":
+ildouble: 2
+ldouble: 2
Test "j0 (-4.0) == -3.9714980986384737228659076845169804197562E-1":
double: 1
float: 2
@@ -752,6 +1142,13 @@ idouble: 1
ifloat: 2
ildouble: 1
ldouble: 1
+Test "j0 (0x1.d7ce3ap+107) == 2.775523647291230802651040996274861694514e-17":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 1
+ldouble: 1
Test "j0 (10.0) == -0.245935764451348335197760862485328754":
double: 3
float: 1
@@ -780,6 +1177,14 @@ ildouble: 1
ldouble: 1
# j1
+Test "j1 (0x1.3ffp+74) == 1.818984347516051243459364437186082741567e-12":
+double: 1
+idouble: 1
+Test "j1 (0x1.ff00000000002p+840) == 1.846591691699331493194965158699937660696e-127":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
Test "j1 (10.0) == 0.0434727461688614366697487680258592883":
float: 2
ifloat: 2
@@ -871,6 +1276,11 @@ double: 1
float: 4
idouble: 1
ifloat: 4
+Test "jn (2, 0x1.ffff62p+99) == -4.43860668048170034334926693188979974489e-16":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
Test "jn (2, 2.4048255576957729) == 0.43175480701968038399746111312430703":
double: 2
float: 1
@@ -1306,6 +1716,14 @@ ldouble: 1
Test "y0 (0.75) == -0.137172769385772397522814379396581855":
ildouble: 1
ldouble: 1
+Test "y0 (0x1.3ffp+74) == 1.818984347516051243459467456433028748678e-12":
+double: 1
+idouble: 1
+Test "y0 (0x1.ff00000000002p+840) == 1.846591691699331493194965158699937660696e-127":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
Test "y0 (1.0) == 0.0882569642156769579829267660235151628":
double: 2
float: 1
@@ -1340,6 +1758,16 @@ ldouble: 1
Test "y1 (0.125) == -5.19993611253477499595928744876579921":
double: 1
idouble: 1
+Test "y1 (0x1.001000001p+593) == 3.927269966354206207832593635798954916263e-90":
+ildouble: 2
+ldouble: 2
+Test "y1 (0x1.27e204p+99) == -8.881610148467797208469612080785210013461e-16":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
Test "y1 (1.5) == -0.412308626973911295952829820633445323":
float: 1
ifloat: 1
@@ -1500,12 +1928,18 @@ ildouble: 1
ldouble: 1
Function: Real part of "cacos":
+double: 1
+idouble: 1
ildouble: 1
ldouble: 1
Function: Imaginary part of "cacos":
-ildouble: 1
-ldouble: 1
+double: 3
+float: 1
+idouble: 3
+ifloat: 1
+ildouble: 2
+ldouble: 2
Function: Real part of "cacosh":
double: 1
@@ -1520,6 +1954,8 @@ double: 1
float: 3
idouble: 1
ifloat: 3
+ildouble: 1
+ldouble: 1
Function: Real part of "casin":
double: 1
@@ -1530,8 +1966,12 @@ ildouble: 1
ldouble: 1
Function: Imaginary part of "casin":
-ildouble: 1
-ldouble: 1
+double: 3
+float: 1
+idouble: 3
+ifloat: 1
+ildouble: 2
+ldouble: 2
Function: Real part of "casinh":
double: 5
@@ -1741,17 +2181,17 @@ ldouble: 1
Function: Real part of "csqrt":
double: 1
-float: 1
+float: 2
idouble: 1
-ifloat: 1
+ifloat: 2
ildouble: 1
ldouble: 1
Function: Imaginary part of "csqrt":
double: 1
-float: 1
+float: 2
idouble: 1
-ifloat: 1
+ifloat: 2
ildouble: 1
ldouble: 1
@@ -1856,8 +2296,8 @@ double: 3
float: 2
idouble: 3
ifloat: 2
-ildouble: 1
-ldouble: 1
+ildouble: 2
+ldouble: 2
Function: "j1":
double: 1
diff --git a/libc/sysdeps/powerpc/powerpc32/dl-machine.c b/libc/sysdeps/powerpc/powerpc32/dl-machine.c
index 70f4cdb30..3f49707f4 100644
--- a/libc/sysdeps/powerpc/powerpc32/dl-machine.c
+++ b/libc/sysdeps/powerpc/powerpc32/dl-machine.c
@@ -23,7 +23,7 @@
#include <ldsodefs.h>
#include <elf/dynamic-link.h>
#include <dl-machine.h>
-#include <stdio-common/_itoa.h>
+#include <_itoa.h>
/* The value __cache_line_size is defined in dl-sysdep.c and is initialised
by _dl_sysdep_start via DL_PLATFORM_INIT. */
diff --git a/libc/sysdeps/powerpc/powerpc32/power4/hp-timing.h b/libc/sysdeps/powerpc/powerpc32/power4/hp-timing.h
index 8370f7269..a80168a7c 100644
--- a/libc/sysdeps/powerpc/powerpc32/power4/hp-timing.h
+++ b/libc/sysdeps/powerpc/powerpc32/power4/hp-timing.h
@@ -22,7 +22,7 @@
#include <string.h>
#include <sys/param.h>
-#include <stdio-common/_itoa.h>
+#include <_itoa.h>
#include <atomic.h>
/* The macros defined here use the powerpc 64-bit time base register.
diff --git a/libc/sysdeps/powerpc/powerpc32/register-dump.h b/libc/sysdeps/powerpc/powerpc32/register-dump.h
index d9b520e5e..2936de240 100644
--- a/libc/sysdeps/powerpc/powerpc32/register-dump.h
+++ b/libc/sysdeps/powerpc/powerpc32/register-dump.h
@@ -17,7 +17,7 @@
<http://www.gnu.org/licenses/>. */
#include <sys/uio.h>
-#include <stdio-common/_itoa.h>
+#include <_itoa.h>
/* This prints out the information in the following form: */
static const char dumpform[] = "\
diff --git a/libc/sysdeps/powerpc/powerpc64/dl-machine.c b/libc/sysdeps/powerpc/powerpc64/dl-machine.c
index 6a8e68f39..8e216ed87 100644
--- a/libc/sysdeps/powerpc/powerpc64/dl-machine.c
+++ b/libc/sysdeps/powerpc/powerpc64/dl-machine.c
@@ -19,7 +19,7 @@
#include <string.h>
#include <unistd.h>
#include <ldsodefs.h>
-#include <stdio-common/_itoa.h>
+#include <_itoa.h>
#include <dl-machine.h>
void
diff --git a/libc/sysdeps/powerpc/powerpc64/hp-timing.h b/libc/sysdeps/powerpc/powerpc64/hp-timing.h
index b4cf2a42c..dc10bc4f6 100644
--- a/libc/sysdeps/powerpc/powerpc64/hp-timing.h
+++ b/libc/sysdeps/powerpc/powerpc64/hp-timing.h
@@ -22,7 +22,7 @@
#include <string.h>
#include <sys/param.h>
-#include <stdio-common/_itoa.h>
+#include <_itoa.h>
#include <atomic.h>
/* The macros defined here use the powerpc 64-bit time base register.
diff --git a/libc/sysdeps/powerpc/powerpc64/register-dump.h b/libc/sysdeps/powerpc/powerpc64/register-dump.h
index e301b0fe6..917886db2 100644
--- a/libc/sysdeps/powerpc/powerpc64/register-dump.h
+++ b/libc/sysdeps/powerpc/powerpc64/register-dump.h
@@ -17,7 +17,7 @@
<http://www.gnu.org/licenses/>. */
#include <sys/uio.h>
-#include <stdio-common/_itoa.h>
+#include <_itoa.h>
/* This prints out the information in the following form: */
static const char dumpform[] = "\
diff --git a/libc/sysdeps/sparc/Makefile b/libc/sysdeps/sparc/Makefile
index 45609d55f..1dd70e8b5 100644
--- a/libc/sysdeps/sparc/Makefile
+++ b/libc/sysdeps/sparc/Makefile
@@ -12,8 +12,6 @@ CPPFLAGS += -DHAVE_SPINLOCKS=1 -DHAVE_ASSEM_SPARC_GCC=1
endif
ifeq ($(subdir),csu)
-# get offset to rtld_global._dl_hwcap
-gen-as-const-headers += rtld-global-offsets.sym
CPPFLAGS-crti.S += -fPIC
CPPFLAGS-crtn.S += -fPIC
endif
diff --git a/libc/sysdeps/sparc/configure b/libc/sysdeps/sparc/configure
new file mode 100644
index 000000000..9ce761b3b
--- /dev/null
+++ b/libc/sysdeps/sparc/configure
@@ -0,0 +1,124 @@
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+ return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+ set +e
+ as_fn_set_status $1
+ exit $1
+} # as_fn_exit
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+
+
+ as_lineno_1=$LINENO as_lineno_1a=$LINENO
+ as_lineno_2=$LINENO as_lineno_2a=$LINENO
+ eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
+ test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
+ # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-)
+ sed -n '
+ p
+ /[$]LINENO/=
+ ' <$as_myself |
+ sed '
+ s/[$]LINENO.*/&-/
+ t lineno
+ b
+ :lineno
+ N
+ :loop
+ s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+ t loop
+ s/-\n.*//
+ ' >$as_me.lineno &&
+ chmod +x "$as_me.lineno" ||
+ { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
+
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensitive to this).
+ . "./$as_me.lineno"
+ # Exit status is that of the last command.
+ exit
+}
+
+# This file is generated from configure.in by Autoconf. DO NOT EDIT!
+ # Local configure fragment for sysdeps/sparc.
+
+# Check for support of VIS3 et al. instructions in the assembler.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sparc assembler VIS3 support" >&5
+$as_echo_n "checking for sparc assembler VIS3 support... " >&6; }
+if ${libc_cv_sparc_as_vis3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat > conftest.S <<\EOF
+ .text
+foo: fmadds %f1, %f2, %f3, %f5
+ fmaddd %f2, %f4, %f8, %f10
+ fhadds %f2, %f3, %f5
+ fhaddd %f4, %f8, %f10
+ pdistn %f2, %f4, %g1
+ movdtox %f10, %o0
+ movstouw %f9, %o1
+ movstosw %f7, %o2
+ movxtod %o3, %f18
+ movwtos %o4, %f15
+ flcmps %fcc0, %f3, %f5
+ flcmpd %fcc1, %f4, %f6
+EOF
+if { ac_try='${CC-cc} -c $CFLAGS -Wa,-Av9d conftest.S'
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }; then
+ libc_cv_sparc_as_vis3=yes
+else
+ libc_cv_sparc_as_vis3=no
+fi
+rm -f conftest*
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_sparc_as_vis3" >&5
+$as_echo "$libc_cv_sparc_as_vis3" >&6; }
+if test $libc_cv_sparc_as_vis3 = yes; then
+ $as_echo "#define HAVE_AS_VIS3_SUPPORT 1" >>confdefs.h
+
+fi
diff --git a/libc/sysdeps/sparc/configure.in b/libc/sysdeps/sparc/configure.in
new file mode 100644
index 000000000..b80d9cbf5
--- /dev/null
+++ b/libc/sysdeps/sparc/configure.in
@@ -0,0 +1,30 @@
+GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
+# Local configure fragment for sysdeps/sparc.
+
+# Check for support of VIS3 et al. instructions in the assembler.
+AC_CACHE_CHECK(for sparc assembler VIS3 support, libc_cv_sparc_as_vis3, [dnl
+cat > conftest.S <<\EOF
+ .text
+foo: fmadds %f1, %f2, %f3, %f5
+ fmaddd %f2, %f4, %f8, %f10
+ fhadds %f2, %f3, %f5
+ fhaddd %f4, %f8, %f10
+ pdistn %f2, %f4, %g1
+ movdtox %f10, %o0
+ movstouw %f9, %o1
+ movstosw %f7, %o2
+ movxtod %o3, %f18
+ movwtos %o4, %f15
+ flcmps %fcc0, %f3, %f5
+ flcmpd %fcc1, %f4, %f6
+EOF
+dnl
+if AC_TRY_COMMAND([${CC-cc} -c $CFLAGS -Wa,-Av9d conftest.S]); then
+ libc_cv_sparc_as_vis3=yes
+else
+ libc_cv_sparc_as_vis3=no
+fi
+rm -f conftest*])
+if test $libc_cv_sparc_as_vis3 = yes; then
+ AC_DEFINE(HAVE_AS_VIS3_SUPPORT)
+fi
diff --git a/libc/sysdeps/sparc/elf/rtld-global-offsets.sym b/libc/sysdeps/sparc/elf/rtld-global-offsets.sym
deleted file mode 100644
index ff4e97f2a..000000000
--- a/libc/sysdeps/sparc/elf/rtld-global-offsets.sym
+++ /dev/null
@@ -1,7 +0,0 @@
-#define SHARED 1
-
-#include <ldsodefs.h>
-
-#define rtld_global_ro_offsetof(mem) offsetof (struct rtld_global_ro, mem)
-
-RTLD_GLOBAL_RO_DL_HWCAP_OFFSET rtld_global_ro_offsetof (_dl_hwcap)
diff --git a/libc/sysdeps/sparc/fpu/fenv_private.h b/libc/sysdeps/sparc/fpu/fenv_private.h
new file mode 100644
index 000000000..a6e8e95a5
--- /dev/null
+++ b/libc/sysdeps/sparc/fpu/fenv_private.h
@@ -0,0 +1,106 @@
+#ifndef FENV_PRIVATE_H
+#define FENV_PRIVATE_H 1
+
+#include <fenv.h>
+
+static __always_inline void
+libc_feholdexcept (fenv_t *e)
+{
+ fenv_t etmp;
+ __fenv_stfsr(etmp);
+ *(e) = etmp;
+ etmp = etmp & ~((0x1f << 23) | FE_ALL_EXCEPT);
+ __fenv_ldfsr(etmp);
+}
+
+static __always_inline void
+libc_feholdexcept_setround (fenv_t *e, int r)
+{
+ fenv_t etmp;
+ __fenv_stfsr(etmp);
+ *(e) = etmp;
+ etmp = etmp & ~((0x1f << 23) | FE_ALL_EXCEPT);
+ etmp = (etmp & ~__FE_ROUND_MASK) | (r);
+ __fenv_ldfsr(etmp);
+}
+
+static __always_inline int
+libc_fetestexcept (int e)
+{
+ fenv_t etmp;
+ __fenv_stfsr(etmp);
+ return etmp & (e) & FE_ALL_EXCEPT;
+}
+
+static __always_inline void
+libc_fesetenv (fenv_t *e)
+{
+ __fenv_ldfsr(*e);
+}
+
+static __always_inline int
+libc_feupdateenv_test (fenv_t *e, int ex)
+{
+ fenv_t etmp;
+
+ __fenv_stfsr(etmp);
+ etmp &= FE_ALL_EXCEPT;
+
+ __fenv_ldfsr(*e);
+
+ __feraiseexcept (etmp);
+
+ return etmp & ex;
+}
+
+static __always_inline void
+libc_feupdateenv (fenv_t *e)
+{
+ libc_feupdateenv_test (e, 0);
+}
+
+static __always_inline void
+libc_feholdsetround (fenv_t *e, int r)
+{
+ fenv_t etmp;
+ __fenv_stfsr(etmp);
+ *(e) = etmp;
+ etmp = (etmp & ~__FE_ROUND_MASK) | (r);
+ __fenv_ldfsr(etmp);
+}
+
+static __always_inline void
+libc_feresetround (fenv_t *e)
+{
+ fenv_t etmp;
+ __fenv_stfsr(etmp);
+ etmp = (etmp & ~__FE_ROUND_MASK) | (*e & __FE_ROUND_MASK);
+ __fenv_ldfsr(etmp);
+}
+
+#define libc_feholdexceptf libc_feholdexcept
+#define libc_feholdexcept_setroundf libc_feholdexcept_setround
+#define libc_fetestexceptf libc_fetestexcept
+#define libc_fesetenvf libc_fesetenv
+#define libc_feupdateenv_testf libc_feupdateenv_test
+#define libc_feupdateenvf libc_feupdateenv
+#define libc_feholdsetroundf libc_feholdsetround
+#define libc_feresetroundf libc_feresetround
+#define libc_feholdexcept libc_feholdexcept
+#define libc_feholdexcept_setround libc_feholdexcept_setround
+#define libc_fetestexcept libc_fetestexcept
+#define libc_fesetenv libc_fesetenv
+#define libc_feupdateenv_test libc_feupdateenv_test
+#define libc_feupdateenv libc_feupdateenv
+#define libc_feholdsetround libc_feholdsetround
+#define libc_feresetround libc_feresetround
+#define libc_feholdexceptl libc_feholdexcept
+#define libc_feholdexcept_setroundl libc_feholdexcept_setround
+#define libc_fetestexceptl libc_fetestexcept
+#define libc_fesetenvl libc_fesetenv
+#define libc_feupdateenv_testl libc_feupdateenv_test
+#define libc_feupdateenvl libc_feupdateenv
+#define libc_feholdsetroundl libc_feholdsetround
+#define libc_feresetroundl libc_feresetround
+
+#endif /* FENV_PRIVATE_H */
diff --git a/libc/sysdeps/sparc/fpu/libm-test-ulps b/libc/sysdeps/sparc/fpu/libm-test-ulps
index 178c1971b..c07a26a4d 100644
--- a/libc/sysdeps/sparc/fpu/libm-test-ulps
+++ b/libc/sysdeps/sparc/fpu/libm-test-ulps
@@ -2,18 +2,16 @@
# atan2
Test "atan2 (-0.00756827042671106339, -.001792735857538728036) == -1.80338464113663849327153994379639112":
-float: 6
-ifloat: 6
ildouble: 1
ldouble: 1
Test "atan2 (-0.75, -1.0) == -2.49809154479650885165983415456218025":
-float: 3
-ifloat: 3
+float: 1
+ifloat: 1
ildouble: 1
ldouble: 1
Test "atan2 (0.75, -1.0) == 2.49809154479650885165983415456218025":
-float: 3
-ifloat: 3
+float: 1
+ifloat: 1
ildouble: 1
ldouble: 1
Test "atan2 (1.390625, 0.9296875) == 0.981498387184244311516296577615519772":
@@ -28,27 +26,295 @@ float: 1
ifloat: 1
# cacos
+Test "Imaginary part of: cacos (+0 + 0.5 i) == pi/2 - 0.4812118250596034474977589134243684231352 i":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacos (+0 + 1.0 i) == pi/2 - 0.8813735870195430252326093249797923090282 i":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 3
+ldouble: 3
+Test "Imaginary part of: cacos (+0 + 1.5 i) == pi/2 - 1.194763217287109304111930828519090523536 i":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 2
+ldouble: 2
+Test "Imaginary part of: cacos (+0 - 0.5 i) == pi/2 + 0.4812118250596034474977589134243684231352 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacos (+0 - 1.0 i) == pi/2 + 0.8813735870195430252326093249797923090282 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacos (+0 - 1.5 i) == pi/2 + 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacos (-0 + 0.5 i) == pi/2 - 0.4812118250596034474977589134243684231352 i":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacos (-0 + 1.0 i) == pi/2 - 0.8813735870195430252326093249797923090282 i":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 3
+ldouble: 3
+Test "Imaginary part of: cacos (-0 + 1.5 i) == pi/2 - 1.194763217287109304111930828519090523536 i":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 2
+ldouble: 2
+Test "Imaginary part of: cacos (-0 - 0.5 i) == pi/2 + 0.4812118250596034474977589134243684231352 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacos (-0 - 1.0 i) == pi/2 + 0.8813735870195430252326093249797923090282 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacos (-0 - 1.5 i) == pi/2 + 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacos (-1.5 + +0 i) == pi - 0.9624236501192068949955178268487368462704 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: cacos (0.5 + +0 i) == 1.047197551196597746154214461093167628066 - 0 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: cacos (0.5 - 0 i) == 1.047197551196597746154214461093167628066 + +0 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
Test "Imaginary part of: cacos (0.75 + 1.25 i) == 1.11752014915610270578240049553777969 - 1.13239363160530819522266333696834467 i":
ildouble: 1
ldouble: 1
+Test "Imaginary part of: cacos (1.5 + +0 i) == +0 - 0.9624236501192068949955178268487368462704 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
# cacosh
-Test "Real part of: cacosh (-2 - 3 i) == 1.9833870299165354323470769028940395 - 2.1414491111159960199416055713254211 i":
+Test "Real part of: cacosh (+0 + 0.5 i) == 0.4812118250596034474977589134243684231352 + pi/2 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: cacosh (+0 + 1.0 i) == 0.8813735870195430252326093249797923090282 + pi/2 i":
double: 1
-float: 7
+float: 1
idouble: 1
-ifloat: 7
-ildouble: 5
-ldouble: 5
-Test "Imaginary part of: cacosh (-2 - 3 i) == 1.9833870299165354323470769028940395 - 2.1414491111159960199416055713254211 i":
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: cacosh (+0 + 1.5 i) == 1.194763217287109304111930828519090523536 + pi/2 i":
double: 1
-float: 3
idouble: 1
-ifloat: 3
+ildouble: 1
+ldouble: 1
+Test "Real part of: cacosh (+0 - 0.5 i) == 0.4812118250596034474977589134243684231352 - pi/2 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: cacosh (+0 - 1.0 i) == 0.8813735870195430252326093249797923090282 - pi/2 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: cacosh (+0 - 1.5 i) == 1.194763217287109304111930828519090523536 - pi/2 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: cacosh (-0 + 0.5 i) == 0.4812118250596034474977589134243684231352 + pi/2 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: cacosh (-0 + 1.0 i) == 0.8813735870195430252326093249797923090282 + pi/2 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: cacosh (-0 + 1.5 i) == 1.194763217287109304111930828519090523536 + pi/2 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: cacosh (-0 - 0.5 i) == 0.4812118250596034474977589134243684231352 - pi/2 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: cacosh (-0 - 1.0 i) == 0.8813735870195430252326093249797923090282 - pi/2 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: cacosh (-0 - 1.5 i) == 1.194763217287109304111930828519090523536 - pi/2 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacosh (-0.5 + +0 i) == +0 + 2.094395102393195492308428922186335256131 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: cacosh (-0.5 - 0 i) == +0 - 2.094395102393195492308428922186335256131 i":
+double: 1
+idouble: 1
+Test "Real part of: cacosh (-1.5 + +0 i) == 0.9624236501192068949955178268487368462704 + pi i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: cacosh (-1.5 - 0 i) == 0.9624236501192068949955178268487368462704 - pi i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacosh (-2 - 3 i) == 1.9833870299165354323470769028940395 - 2.1414491111159960199416055713254211 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: cacosh (1.5 + +0 i) == 0.9624236501192068949955178268487368462704 + +0 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: cacosh (1.5 - 0 i) == 0.9624236501192068949955178268487368462704 - 0 i":
+float: 1
+ifloat: 1
ildouble: 1
ldouble: 1
# casin
+Test "Imaginary part of: casin (+0 + 0.5 i) == +0 + 0.4812118250596034474977589134243684231352 i":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (+0 + 1.0 i) == +0 + 0.8813735870195430252326093249797923090282 i":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 3
+ldouble: 3
+Test "Imaginary part of: casin (+0 + 1.5 i) == +0 + 1.194763217287109304111930828519090523536 i":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 2
+ldouble: 2
+Test "Imaginary part of: casin (+0 - 0.5 i) == +0 - 0.4812118250596034474977589134243684231352 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (+0 - 1.0 i) == +0 - 0.8813735870195430252326093249797923090282 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (+0 - 1.5 i) == +0 - 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (-0 + 0.5 i) == -0 + 0.4812118250596034474977589134243684231352 i":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (-0 + 1.0 i) == -0 + 0.8813735870195430252326093249797923090282 i":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 3
+ldouble: 3
+Test "Imaginary part of: casin (-0 + 1.5 i) == -0 + 1.194763217287109304111930828519090523536 i":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 2
+ldouble: 2
+Test "Imaginary part of: casin (-0 - 0.5 i) == -0 - 0.4812118250596034474977589134243684231352 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (-0 - 1.0 i) == -0 - 0.8813735870195430252326093249797923090282 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (-0 - 1.5 i) == -0 - 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casin (-1.5 + +0 i) == -pi/2 + 0.9624236501192068949955178268487368462704 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
Test "Real part of: casin (0.75 + 1.25 i) == 0.453276177638793913448921196101971749 + 1.13239363160530819522266333696834467 i":
double: 1
float: 1
@@ -57,8 +323,71 @@ ifloat: 1
Test "Imaginary part of: casin (0.75 + 1.25 i) == 0.453276177638793913448921196101971749 + 1.13239363160530819522266333696834467 i":
ildouble: 1
ldouble: 1
+Test "Imaginary part of: casin (1.5 + +0 i) == pi/2 + 0.9624236501192068949955178268487368462704 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
# casinh
+Test "Real part of: casinh (-0 + 1.5 i) == -0.9624236501192068949955178268487368462704 + pi/2 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: casinh (-0 - 1.5 i) == -0.9624236501192068949955178268487368462704 - pi/2 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: casinh (-0.5 + +0 i) == -0.4812118250596034474977589134243684231352 + +0 i":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: casinh (-0.5 - 0 i) == -0.4812118250596034474977589134243684231352 - 0 i":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: casinh (-1.0 + +0 i) == -0.8813735870195430252326093249797923090282 + +0 i":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 3
+ldouble: 3
+Test "Real part of: casinh (-1.0 - 0 i) == -0.8813735870195430252326093249797923090282 - 0 i":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 3
+ldouble: 3
+Test "Real part of: casinh (-1.5 + +0 i) == -1.194763217287109304111930828519090523536 + +0 i":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 2
+ldouble: 2
+Test "Real part of: casinh (-1.5 - 0 i) == -1.194763217287109304111930828519090523536 - 0 i":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 2
+ldouble: 2
Test "Real part of: casinh (-2 - 3 i) == -1.9686379257930962917886650952454982 - 0.96465850440760279204541105949953237 i":
double: 5
float: 1
@@ -73,6 +402,16 @@ idouble: 3
ifloat: 6
ildouble: 2
ldouble: 2
+Test "Real part of: casinh (0.5 + +0 i) == 0.4812118250596034474977589134243684231352 + +0 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: casinh (0.5 - 0 i) == 0.4812118250596034474977589134243684231352 - 0 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
Test "Real part of: casinh (0.75 + 1.25 i) == 1.03171853444778027336364058631006594 + 0.911738290968487636358489564316731207 i":
float: 1
ifloat: 1
@@ -85,19 +424,37 @@ idouble: 1
ifloat: 1
ildouble: 1
ldouble: 1
+Test "Real part of: casinh (1.0 + +0 i) == 0.8813735870195430252326093249797923090282 + +0 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: casinh (1.0 - 0 i) == 0.8813735870195430252326093249797923090282 - 0 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: casinh (1.5 + +0 i) == 1.194763217287109304111930828519090523536 + +0 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: casinh (1.5 - 0 i) == 1.194763217287109304111930828519090523536 - 0 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
# catan
-Test "Real part of: catan (-2 - 3 i) == -1.4099210495965755225306193844604208 - 0.22907268296853876629588180294200276 i":
-float: 3
-ifloat: 3
Test "Imaginary part of: catan (-2 - 3 i) == -1.4099210495965755225306193844604208 - 0.22907268296853876629588180294200276 i":
double: 1
float: 1
idouble: 1
ifloat: 1
-Test "Real part of: catan (0.75 + 1.25 i) == 1.10714871779409050301706546017853704 + 0.549306144334054845697622618461262852 i":
-float: 4
-ifloat: 4
Test "Imaginary part of: catan (0.75 + 1.25 i) == 1.10714871779409050301706546017853704 + 0.549306144334054845697622618461262852 i":
ildouble: 1
ldouble: 1
@@ -106,17 +463,12 @@ ldouble: 1
Test "Real part of: catanh (-2 - 3 i) == -0.14694666622552975204743278515471595 - 1.3389725222944935611241935759091443 i":
double: 4
idouble: 4
-Test "Imaginary part of: catanh (-2 - 3 i) == -0.14694666622552975204743278515471595 - 1.3389725222944935611241935759091443 i":
-float: 4
-ifloat: 4
Test "Real part of: catanh (0.75 + 1.25 i) == 0.261492138795671927078652057366532140 + 0.996825126463918666098902241310446708 i":
double: 1
idouble: 1
ildouble: 1
ldouble: 1
Test "Imaginary part of: catanh (0.75 + 1.25 i) == 0.261492138795671927078652057366532140 + 0.996825126463918666098902241310446708 i":
-float: 6
-ifloat: 6
ildouble: 1
ldouble: 1
@@ -189,14 +541,20 @@ ildouble: 1
ldouble: 1
# clog
-Test "Imaginary part of: clog (-2 - 3 i) == 1.2824746787307683680267437207826593 - 2.1587989303424641704769327722648368 i":
-float: 3
-ifloat: 3
Test "Real part of: clog (0.75 + 1.25 i) == 0.376885901188190075998919126749298416 + 1.03037682652431246378774332703115153 i":
float: 1
ifloat: 1
ildouble: 1
ldouble: 1
+Test "Real part of: clog (0x1.fp+16383 + 0x1.fp+16383 i) == 11356.83823118610934184548269774874545400 + pi/4 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog (0x1p-1074 + 0x1p-1074 i) == -744.0934983311012896593986823853525458290 + pi/4 i":
+double: 1
+idouble: 1
+Test "Real part of: clog (0x1p-147 + 0x1p-147 i) == -101.5460619520319878296245057936228672231 + pi/4 i":
+float: 1
+ifloat: 1
# clog10
Test "Imaginary part of: clog10 (-0 + inf i) == inf + pi/2*log10(e) i":
@@ -214,9 +572,7 @@ ildouble: 1
ldouble: 1
Test "Imaginary part of: clog10 (-2 - 3 i) == 0.556971676153418384603252578971164214 - 0.937554462986374708541507952140189646 i":
double: 1
-float: 5
idouble: 1
-ifloat: 5
ildouble: 1
ldouble: 1
Test "Imaginary part of: clog10 (-3 + inf i) == inf + pi/2*log10(e) i":
@@ -268,6 +624,42 @@ ifloat: 1
Test "Imaginary part of: clog10 (0.75 + 1.25 i) == 0.163679467193165171449476605077428975 + 0.447486970040493067069984724340855636 i":
ildouble: 1
ldouble: 1
+Test "Imaginary part of: clog10 (0x1.fffffep+127 + 0x1.fffffep+127 i) == 38.68235441693561449174780668781319348761 + pi/4*log10(e) i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Real part of: clog10 (0x1.fffffep+127 + 1.0 i) == 38.53183941910362389414093724045094697423 + 1.276276851248440096917018665609900318458e-39 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: clog10 (0x1.fffffffffffffp+1023 + 0x1.fffffffffffffp+1023 i) == 308.4052305577487344482591243175787477115 + pi/4*log10(e) i":
+double: 1
+idouble: 1
+Test "Real part of: clog10 (0x1.fp+16383 + 0x1.fp+16383 i) == 4932.212175672014259683102930239951947672 + pi/4*log10(e) i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog10 (0x1.fp+16383 + 0x1p+16383 i) == 4932.112944269463028900262609694408579449 + 0.2069271710841128115912940666587802677383 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (0x1p-1073 + 0x1p-1073 i) == -322.8546703496198318667349645920187712089 + pi/4*log10(e) i":
+double: 1
+idouble: 1
+Test "Real part of: clog10 (0x1p-1074 + 0x1p-1074 i) == -323.1557003452838130619487034867432642357 + pi/4*log10(e) i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (0x1p-1074 + 0x1p-1074 i) == -323.1557003452838130619487034867432642357 + pi/4*log10(e) i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (0x1p-147 + 0x1p-147 i) == -44.10089436477324509881274807713822842154 + pi/4*log10(e) i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Imaginary part of: clog10 (0x1p-149 + 0x1p-149 i) == -44.70295435610120748924022586658721447508 + pi/4*log10(e) i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
Test "Imaginary part of: clog10 (3 + inf i) == inf + pi/2*log10(e) i":
double: 1
float: 1
@@ -292,9 +684,7 @@ ifloat: 1
# cos
Test "cos (M_PI_6l * 2.0) == 0.5":
double: 1
-float: 1
idouble: 1
-ifloat: 1
ildouble: 1
ldouble: 1
Test "cos (M_PI_6l * 4.0) == -0.5":
@@ -304,13 +694,6 @@ idouble: 2
ifloat: 1
ildouble: 1
ldouble: 1
-Test "cos (pi/2) == 0":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
-ildouble: 1
-ldouble: 1
# cos_downward
Test "cos_downward (1) == 0.5403023058681397174009366074429766037323":
@@ -419,23 +802,51 @@ ldouble: 1
Test "cosh_downward (22) == 1792456423.065795780980053377632656584997":
float: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
Test "cosh_downward (23) == 4872401723.124451300068625740569997090344":
float: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
Test "cosh_downward (24) == 13244561064.92173614708845674912733665919":
float: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
+
+# cosh_tonearest
+Test "cosh_tonearest (22) == 1792456423.065795780980053377632656584997":
+ildouble: 1
+ldouble: 1
# cosh_towardzero
Test "cosh_towardzero (22) == 1792456423.065795780980053377632656584997":
float: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
Test "cosh_towardzero (23) == 4872401723.124451300068625740569997090344":
float: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
Test "cosh_towardzero (24) == 13244561064.92173614708845674912733665919":
float: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
+
+# cosh_upward
+Test "cosh_upward (22) == 1792456423.065795780980053377632656584997":
+ildouble: 1
+ldouble: 1
+Test "cosh_upward (23) == 4872401723.124451300068625740569997090344":
+ildouble: 1
+ldouble: 1
+Test "cosh_upward (24) == 13244561064.92173614708845674912733665919":
+ildouble: 1
+ldouble: 1
# cpow
Test "Real part of: cpow (0.75 + 1.25 i, 0.0 + 1.0 i) == 0.331825439177608832276067945276730566 + 0.131338600281188544930936345230903032 i":
@@ -521,11 +932,37 @@ ldouble: 1
Test "Imaginary part of: csqrt (0.75 + 1.25 i) == 1.05065169626078392338656675760808326 + 0.594868882070379067881984030639932657 i":
ildouble: 1
ldouble: 1
+Test "Imaginary part of: csqrt (0x1.fffffep+127 + 1.0 i) == 1.844674352395372953599975585936590505260e+19 + 2.710505511993121390769065968615872097053e-20 i":
+float: 1
+ifloat: 1
+Test "Real part of: csqrt (0x1.fffffffffffffp+1023 + 0x1.fffffffffffffp+1023 i) == 1.473094556905565378990473658199034571917e+154 + 6.101757441282702188537080005372547713595e+153 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: csqrt (0x1.fffffffffffffp+1023 + 0x1.fffffffffffffp+1023 i) == 1.473094556905565378990473658199034571917e+154 + 6.101757441282702188537080005372547713595e+153 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: csqrt (0x1.fffffffffffffp+1023 + 0x1p+1023 i) == 1.379778091031440685006200821918878702861e+154 + 3.257214233483129514781233066898042490248e+153 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: csqrt (0x1.fp+16383 + 0x1.fp+16383 i) == 1.179514222452201722651836720466795901016e+2466 + 4.885707879516577666702435054303191575148e+2465 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: csqrt (0x1.fp+16383 + 0x1.fp+16383 i) == 1.179514222452201722651836720466795901016e+2466 + 4.885707879516577666702435054303191575148e+2465 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: csqrt (0x1.fp+16383 + 0x1p+16383 i) == 1.106698967236475180613254276996359485630e+2466 + 2.687568007603946993388538156299100955642e+2465 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: csqrt (0x1p-16440 + 0x1p-16441 i) == 3.514690655930285351254618340783294558136e-2475 + 8.297059146828716918029689466551384219370e-2476 i":
+ildouble: 1
+ldouble: 1
# ctan
Test "Real part of: ctan (-2 - 3 i) == 0.376402564150424829275122113032269084e-2 - 1.00323862735360980144635859782192726 i":
-double: 1
-idouble: 1
ildouble: 1
ldouble: 1
Test "Imaginary part of: ctan (-2 - 3 i) == 0.376402564150424829275122113032269084e-2 - 1.00323862735360980144635859782192726 i":
@@ -681,6 +1118,9 @@ float: 1
ifloat: 1
# j0
+Test "j0 (-0x1.001000001p+593) == -3.927269966354206207832593635798954916263e-90":
+ildouble: 1
+ldouble: 1
Test "j0 (-4.0) == -3.9714980986384737228659076845169804197562E-1":
double: 1
float: 1
@@ -689,6 +1129,11 @@ ifloat: 1
Test "j0 (0.75) == 0.864242275166648623555731103820923211":
float: 1
ifloat: 1
+Test "j0 (0x1.d7ce3ap+107) == 2.775523647291230802651040996274861694514e-17":
+float: 2
+ifloat: 2
+ildouble: 1
+ldouble: 1
Test "j0 (10.0) == -0.245935764451348335197760862485328754":
double: 2
float: 1
@@ -719,6 +1164,16 @@ ldouble: 1
Test "j1 (0.75) == 0.349243602174862192523281016426251335":
ildouble: 1
ldouble: 1
+Test "j1 (0x1.3ffp+74) == 1.818984347516051243459364437186082741567e-12":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "j1 (0x1.ff00000000002p+840) == 1.846591691699331493194965158699937660696e-127":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
Test "j1 (1.0) == 0.440050585744933515959682203718914913":
ildouble: 1
ldouble: 1
@@ -818,9 +1273,14 @@ ildouble: 2
ldouble: 2
Test "jn (10, 2.0) == 0.251538628271673670963516093751820639e-6":
double: 1
-float: 4
+float: 2
idouble: 1
-ifloat: 4
+ifloat: 2
+Test "jn (2, 0x1.ffff62p+99) == -4.43860668048170034334926693188979974489e-16":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
Test "jn (2, 2.4048255576957729) == 0.43175480701968038399746111312430703":
double: 2
float: 1
@@ -846,10 +1306,8 @@ ifloat: 1
ildouble: 2
ldouble: 2
Test "jn (3, 2.0) == 0.128943249474402051098793332969239835":
-double: 1
-float: 2
-idouble: 1
-ifloat: 2
+float: 1
+ifloat: 1
Test "jn (3, 2.4048255576957729) == 0.19899990535769083404042146764530813":
double: 3
idouble: 3
@@ -931,9 +1389,6 @@ ldouble: 1
Test "log1p (-0.25) == -0.287682072451780927439219005993827432":
float: 1
ifloat: 1
-Test "log1p (M_El - 1.0) == 1":
-ildouble: 1
-ldouble: 1
# log2
Test "log2 (0.75) == -.415037499278843818546261056052183492":
@@ -954,6 +1409,13 @@ ifloat: 1
Test "pow_upward (1.0625, 1.125) == 1.070582293028761362162622578677070098674":
float: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
+
+# sin
+Test "sin (0x1p1023) == 0.5631277798508840134529434079444683477104":
+ildouble: 1
+ldouble: 1
# sin_downward
Test "sin_downward (1) == 0.8414709848078965066525023216302989996226":
@@ -1066,21 +1528,15 @@ ildouble: 1
ldouble: 1
# sincos
-Test "sincos (M_PI_6l*2.0, &sin_res, &cos_res) puts 0.5 in cos_res":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
+Test "sincos (0x1p1023, &sin_res, &cos_res) puts 0.5631277798508840134529434079444683477104 in sin_res":
ildouble: 1
ldouble: 1
-Test "sincos (M_PI_6l*2.0, &sin_res, &cos_res) puts 0.86602540378443864676372317075293616 in sin_res":
+Test "sincos (M_PI_6l*2.0, &sin_res, &cos_res) puts 0.5 in cos_res":
double: 1
-float: 1
idouble: 1
-ifloat: 1
ildouble: 1
ldouble: 1
-Test "sincos (pi/2, &sin_res, &cos_res) puts 0 in cos_res":
+Test "sincos (M_PI_6l*2.0, &sin_res, &cos_res) puts 0.86602540378443864676372317075293616 in sin_res":
double: 1
float: 1
idouble: 1
@@ -1095,34 +1551,50 @@ ifloat: 1
Test "sinh_downward (22) == 1792456423.065795780701106568345764104225":
float: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
Test "sinh_downward (23) == 4872401723.124451299966006944252978187305":
float: 1
ifloat: 1
+ildouble: 2
+ldouble: 2
Test "sinh_downward (24) == 13244561064.92173614705070540368454568168":
float: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
# sinh_towardzero
Test "sinh_towardzero (22) == 1792456423.065795780701106568345764104225":
float: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
Test "sinh_towardzero (23) == 4872401723.124451299966006944252978187305":
float: 1
ifloat: 1
+ildouble: 2
+ldouble: 2
Test "sinh_towardzero (24) == 13244561064.92173614705070540368454568168":
float: 1
ifloat: 1
+# sinh_upward
+Test "sinh_upward (22) == 1792456423.065795780701106568345764104225":
+ildouble: 1
+ldouble: 1
+Test "sinh_upward (23) == 4872401723.124451299966006944252978187305":
+ildouble: 1
+ldouble: 1
+Test "sinh_upward (24) == 13244561064.92173614705070540368454568168":
+ildouble: 1
+ldouble: 1
+
# sqrt
Test "sqrt (2) == M_SQRT2l":
ildouble: 1
ldouble: 1
-# tan
-Test "tan (pi/4) == 1":
-double: 1
-idouble: 1
-
# tan_downward
Test "tan_downward (1) == 1.5574077246549022305069748074583601730873":
float: 1
@@ -1244,6 +1716,16 @@ ildouble: 1
ldouble: 1
# y0
+Test "y0 (0x1.3ffp+74) == 1.818984347516051243459467456433028748678e-12":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "y0 (0x1.ff00000000002p+840) == 1.846591691699331493194965158699937660696e-127":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
Test "y0 (1.0) == 0.0882569642156769579829267660235151628":
double: 2
float: 1
@@ -1274,6 +1756,12 @@ idouble: 1
Test "y1 (0.75) == -1.03759455076928541973767132140642198":
ildouble: 1
ldouble: 1
+Test "y1 (0x1.001000001p+593) == 3.927269966354206207832593635798954916263e-90":
+ildouble: 1
+ldouble: 1
+Test "y1 (0x1.27e204p+99) == -8.881610148467797208469612080785210013461e-16":
+double: 1
+idouble: 1
Test "y1 (1.5) == -0.412308626973911295952829820633445323":
float: 1
ifloat: 1
@@ -1404,8 +1892,8 @@ idouble: 1
# Maximal error of functions:
Function: "atan2":
-float: 6
-ifloat: 6
+float: 1
+ifloat: 1
ildouble: 1
ldouble: 1
@@ -1413,23 +1901,33 @@ Function: "atanh":
float: 1
ifloat: 1
-Function: Imaginary part of "cacos":
+Function: Real part of "cacos":
+double: 1
+idouble: 1
ildouble: 1
ldouble: 1
+Function: Imaginary part of "cacos":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 3
+ldouble: 3
+
Function: Real part of "cacosh":
double: 1
-float: 7
+float: 1
idouble: 1
-ifloat: 7
-ildouble: 5
-ldouble: 5
+ifloat: 1
+ildouble: 1
+ldouble: 1
Function: Imaginary part of "cacosh":
double: 1
-float: 3
+float: 1
idouble: 1
-ifloat: 3
+ifloat: 1
ildouble: 1
ldouble: 1
@@ -1440,8 +1938,12 @@ idouble: 1
ifloat: 1
Function: Imaginary part of "casin":
-ildouble: 1
-ldouble: 1
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 3
+ldouble: 3
Function: Real part of "casinh":
double: 5
@@ -1459,10 +1961,6 @@ ifloat: 6
ildouble: 2
ldouble: 2
-Function: Real part of "catan":
-float: 4
-ifloat: 4
-
Function: Imaginary part of "catan":
double: 1
float: 1
@@ -1478,8 +1976,6 @@ ildouble: 1
ldouble: 1
Function: Imaginary part of "catanh":
-float: 6
-ifloat: 6
ildouble: 1
ldouble: 1
@@ -1530,26 +2026,26 @@ ildouble: 1
ldouble: 1
Function: Real part of "clog":
+double: 1
float: 1
+idouble: 1
ifloat: 1
ildouble: 1
ldouble: 1
-Function: Imaginary part of "clog":
-float: 3
-ifloat: 3
-
Function: Real part of "clog10":
+double: 1
float: 1
+idouble: 1
ifloat: 1
ildouble: 1
ldouble: 1
Function: Imaginary part of "clog10":
double: 1
-float: 5
+float: 1
idouble: 1
-ifloat: 5
+ifloat: 1
ildouble: 1
ldouble: 1
@@ -1586,10 +2082,22 @@ ldouble: 1
Function: "cosh_downward":
float: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: "cosh_tonearest":
+ildouble: 1
+ldouble: 1
Function: "cosh_towardzero":
float: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: "cosh_upward":
+ildouble: 1
+ldouble: 1
Function: Real part of "cpow":
double: 2
@@ -1628,18 +2136,22 @@ idouble: 1
ifloat: 1
Function: Real part of "csqrt":
+double: 1
float: 1
+idouble: 1
ifloat: 1
ildouble: 1
ldouble: 1
Function: Imaginary part of "csqrt":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
ildouble: 1
ldouble: 1
Function: Real part of "ctan":
-double: 1
-idouble: 1
ildouble: 1
ldouble: 1
@@ -1782,6 +2294,12 @@ ifloat: 1
Function: "pow_upward":
float: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: "sin":
+ildouble: 1
+ldouble: 1
Function: "sin_downward":
float: 1
@@ -1818,10 +2336,18 @@ ldouble: 1
Function: "sinh_downward":
float: 1
ifloat: 1
+ildouble: 2
+ldouble: 2
Function: "sinh_towardzero":
float: 1
ifloat: 1
+ildouble: 2
+ldouble: 2
+
+Function: "sinh_upward":
+ildouble: 1
+ldouble: 1
Function: "sqrt":
ildouble: 1
diff --git a/libc/sysdeps/sparc/fpu/math_private.h b/libc/sysdeps/sparc/fpu/math_private.h
new file mode 100644
index 000000000..27946cec7
--- /dev/null
+++ b/libc/sysdeps/sparc/fpu/math_private.h
@@ -0,0 +1,7 @@
+#ifndef SPARC_MATH_PRIVATE_H
+#define SPARC_MATH_PRIVATE_H 1
+
+#include "fenv_private.h"
+#include_next <math_private.h>
+
+#endif /* SPARC_MATH_PRIVATE_H */
diff --git a/libc/sysdeps/sparc/sparc-ifunc.h b/libc/sysdeps/sparc/sparc-ifunc.h
new file mode 100644
index 000000000..db53a7126
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc-ifunc.h
@@ -0,0 +1,112 @@
+/* This file is part of the GNU C Library.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <sysdep.h>
+
+#ifdef __ASSEMBLER__
+
+# ifdef SHARED
+
+# define SPARC_ASM_IFUNC_DFLT(name, dflt) \
+ENTRY (__##name) \
+ .type __##name, @gnu_indirect_function; \
+ SETUP_PIC_REG_LEAF(o3, o5); \
+ sethi %gdop_hix22(dflt), %o1; \
+ xor %o1, %gdop_lox10(dflt), %o1; \
+ add %o3, %o1, %o1; \
+ retl; \
+ mov %o1, %o0; \
+END (__##name)
+
+# define SPARC_ASM_IFUNC1(name, m1, f1, dflt) \
+ENTRY (__##name) \
+ .type __##name, @gnu_indirect_function; \
+ SETUP_PIC_REG_LEAF(o3, o5); \
+ set m1, %o1; \
+ andcc %o0, %o1, %g0; \
+ be 9f; \
+ nop; \
+ sethi %gdop_hix22(f1), %o1; \
+ xor %o1, %gdop_lox10(f1), %o1; \
+ ba 10f; \
+ nop; \
+9: sethi %gdop_hix22(dflt), %o1; \
+ xor %o1, %gdop_lox10(dflt), %o1; \
+10: add %o3, %o1, %o1; \
+ retl; \
+ mov %o1, %o0; \
+END (__##name)
+
+# else /* SHARED */
+
+# ifdef __arch64__
+# define SET(SYM, TMP, REG) setx SYM, TMP, REG
+# else
+# define SET(SYM, TMP, REG) set SYM, REG
+# endif
+
+# define SPARC_ASM_IFUNC_DFLT(name, dflt) \
+ENTRY (__##name) \
+ .type __##name, @gnu_indirect_function; \
+ SET(dflt, %g1, %o1); \
+ retl; \
+ mov %o1, %o0; \
+END (__##name)
+
+# define SPARC_ASM_IFUNC1(name, m1, f1, dflt) \
+ENTRY (__##name) \
+ .type __##name, @gnu_indirect_function; \
+ set m1, %o1; \
+ andcc %o0, %o1, %g0; \
+ be 9f; \
+ nop; \
+ SET(f1, %g1, %o1); \
+ ba 10f; \
+ nop; \
+9: SET(dflt, %g1, %o1); \
+10: retl; \
+ mov %o1, %o0; \
+END (__##name)
+
+# endif /* SHARED */
+
+# ifdef HAVE_AS_VIS3_SUPPORT
+
+#define SPARC_ASM_VIS3_IFUNC(name) \
+ SPARC_ASM_IFUNC1(name, HWCAP_SPARC_VIS3, \
+ __##name##_vis3, __##name##_generic)
+
+# else /* HAVE_AS_VIS3_SUPPORT */
+
+#define SPARC_ASM_VIS3_IFUNC(name) \
+ SPARC_ASM_IFUNC_DFLT(name, __##name##_generic)
+
+# endif /* HAVE_AS_VIS3_SUPPORT */
+
+
+#else /* __ASSEMBLER__ */
+
+# define sparc_libm_ifunc(name, expr) \
+ extern void *name##_ifunc (int) __asm__ (#name); \
+ void *name##_ifunc (int hwcap) \
+ { \
+ __typeof (name) *res = expr; \
+ return res; \
+ } \
+ __asm__ (".type " #name ", %gnu_indirect_function");
+
+#endif /* __ASSEMBLER__ */
diff --git a/libc/sysdeps/sparc/sparc32/dl-machine.h b/libc/sysdeps/sparc/sparc32/dl-machine.h
index 1620ca54d..f85683d1b 100644
--- a/libc/sysdeps/sparc/sparc32/dl-machine.h
+++ b/libc/sysdeps/sparc/sparc32/dl-machine.h
@@ -1,5 +1,5 @@
/* Machine-dependent ELF dynamic relocation inline functions. SPARC version.
- Copyright (C) 1996-2003, 2004, 2005, 2006, 2007, 2010, 2011
+ Copyright (C) 1996-2003, 2004, 2005, 2006, 2007, 2010, 2011, 2012
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -341,10 +341,14 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
void *const reloc_addr_arg, int skip_ifunc)
{
Elf32_Addr *const reloc_addr = reloc_addr_arg;
+#if !defined RTLD_BOOTSTRAP && !defined RESOLVE_CONFLICT_FIND_MAP
const Elf32_Sym *const refsym = sym;
+#endif
Elf32_Addr value;
const unsigned int r_type = ELF32_R_TYPE (reloc->r_info);
+#if !defined RESOLVE_CONFLICT_FIND_MAP
struct link_map *sym_map = NULL;
+#endif
#if !defined RTLD_BOOTSTRAP && !defined HAVE_Z_COMBRELOC
/* This is defined in rtld.c, but nowhere in the static libc.a; make the
diff --git a/libc/sysdeps/sparc/sparc32/dl-trampoline.S b/libc/sysdeps/sparc/sparc32/dl-trampoline.S
index 79ec79fe9..44794592a 100644
--- a/libc/sysdeps/sparc/sparc32/dl-trampoline.S
+++ b/libc/sysdeps/sparc/sparc32/dl-trampoline.S
@@ -1,5 +1,5 @@
/* PLT trampolines. Sparc 32-bit version.
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -48,17 +48,20 @@ _dl_runtime_resolve:
.size _dl_runtime_resolve, .-_dl_runtime_resolve
/* For the profiling cases we pass in our stack frame
- * as the base of the La_sparc64_regs, so it looks
+ * as the base of the La_sparc32_regs, so it looks
* like:
- * %l0 %sp
+ * %l0 %sp + (0 * 8)
+ * %l1 %sp + (0 * 8) + 4
* ...
- * %l7 %sp + (7 * 8)
- * %i0 %sp + (8 * 8)
+ * %l6 %sp + (3 * 8)
+ * %l7 %sp + (3 * 8) + 4
+ * %i0 %sp + (4 * 8)
+ * %i1 %sp + (4 * 8) + 4
* ...
- * %i7 %sp + (15 * 8)
- * %f0 %sp + (16 * 8)
- * %f16 %sp + (31 * 8)
- * framesize %sp + (32 * 8)
+ * %i6 %sp + (7 * 8)
+ * %i7 %sp + (7 * 8) + 4
+ * struct_ret_ptr %sp + (8 * 8)
+ * framesize %sp + (9 * 8)
*/
.globl _dl_profile_save_regs
@@ -74,7 +77,7 @@ _dl_profile_save_regs:
std %i2, [%sp + ( 5 * 8)]
std %i4, [%sp + ( 6 * 8)]
std %i6, [%sp + ( 7 * 8)]
- ld [%sp + (8 * 8)], %l4
+ ld [%fp + (8 * 8)], %l4
retl
st %l4, [%sp + (8 * 8)]
@@ -91,8 +94,11 @@ _dl_profile_save_regs:
_dl_profile_invoke:
cfi_startproc
- sub %sp, %l0, %sp
-1:
+ add %l0, 7, %l0
+ andn %l0, 7, %l0
+ add %l0, 2 * 8, %g1
+
+ sub %sp, %g1, %sp
srl %l0, 3, %l7
mov %o0, %l1
mov %i0, %o0
@@ -101,8 +107,10 @@ _dl_profile_invoke:
mov %i3, %o3
mov %i4, %o4
mov %i5, %o5
+ cmp %l0, 0
mov %fp, %l2
- mov %sp, %l3
+ be 2f
+ add %sp, (11 * 8), %l3
1: ldd [%l2], %g2
add %l2, 0x8, %l2
subcc %l7, 1, %l7
@@ -110,7 +118,7 @@ _dl_profile_invoke:
bne 1b
add %l3, 0x8, %l3
- jmpl %l1, %o7
+2: jmpl %l1, %o7
nop
std %o0, [%sp + ( 9 * 8)]
@@ -118,11 +126,12 @@ _dl_profile_invoke:
mov %l5, %o0
mov %l6, %o1
- add %sp, %l0, %o2
+ add %sp, (11 * 8), %o2
call _dl_call_pltexit
- add %sp, (16 * 8), %o3
+ add %sp, ( 9 * 8), %o3
- ldd [%sp + (9 * 8)], %i0
+ ldd [%sp + ( 9 * 8)], %i0
+ ldd [%sp + (10 * 8)], %f0
jmpl %i7 + 8, %g0
restore
@@ -142,11 +151,7 @@ _dl_profile_invoke:
_dl_runtime_profile:
cfi_startproc
- cmp %fp, 0
- be,a 1f
- mov 104, %g3
- sub %fp, %sp, %g3
-1: save %sp, -104, %sp
+ save %sp, -104, %sp
cfi_def_cfa_register(%fp)
cfi_window_save
cfi_register(%o7, %i7)
@@ -156,20 +161,19 @@ _dl_runtime_profile:
mov %i7, %o2
sub %o1, 4*12, %o1
- mov %g3, %l0
mov %o0, %l5
mov %o1, %l6
- call _dl_profile_save_regs
+ call _dl_profile_save_regs
nop
mov %sp, %o3
call _dl_profile_fixup
add %sp, (9 * 8), %o4
- ld [%sp + (9 * 8)], %o1
- cmp %o1, 0
- bgeu 1f
+ ld [%sp + (9 * 8)], %l0
+ cmp %l0, 0
+ bl 1f
nop
call _dl_profile_invoke
diff --git a/libc/sysdeps/sparc/sparc32/fpu/s_fma.c b/libc/sysdeps/sparc/sparc32/fpu/s_fma.c
new file mode 100644
index 000000000..8f6260587
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc32/fpu/s_fma.c
@@ -0,0 +1,2 @@
+/* Always use dbl-64 version because long double is emulated in software. */
+#include <sysdeps/ieee754/dbl-64/s_fma.c>
diff --git a/libc/sysdeps/sparc/sparc32/sparcv9/Makefile b/libc/sysdeps/sparc/sparc32/sparcv9/Makefile
index 58f5759b3..8a9330f7a 100644
--- a/libc/sysdeps/sparc/sparc32/sparcv9/Makefile
+++ b/libc/sysdeps/sparc/sparc32/sparcv9/Makefile
@@ -5,9 +5,18 @@ sysdep_routines += hp-timing
elide-routines.os += hp-timing
endif
+ifeq ($(have-as-vis3),yes)
+ASFLAGS-.o += -Wa,-Av9d
+ASFLAGS-.os += -Wa,-Av9d
+ASFLAGS-.op += -Wa,-Av9d
+ASFLAGS-.og += -Wa,-Av9d
+ASFLAGS-.ob += -Wa,-Av9d
+ASFLAGS-.oS += -Wa,-Av9d
+else
ASFLAGS-.o += -Wa,-Av9a
ASFLAGS-.os += -Wa,-Av9a
ASFLAGS-.op += -Wa,-Av9a
ASFLAGS-.og += -Wa,-Av9a
ASFLAGS-.ob += -Wa,-Av9a
ASFLAGS-.oS += -Wa,-Av9a
+endif
diff --git a/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/Makefile b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/Makefile
new file mode 100644
index 000000000..ee9f6ffce
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/Makefile
@@ -0,0 +1,11 @@
+ifeq ($(subdir),math)
+ifeq ($(have-as-vis3),yes)
+libm-sysdep_routines += m_copysignf-vis3 m_copysign-vis3 s_ceilf-vis3 \
+ s_ceil-vis3 s_fabs-vis3 s_fabsf-vis3 s_floor-vis3 \
+ s_floorf-vis3 s_llrintf-vis3 s_llrint-vis3 \
+ s_rintf-vis3 s_rint-vis3 w_sqrt-vis3 w_sqrtf-vis3 \
+ s_fminf-vis3 s_fmin-vis3 s_fmaxf-vis3 s_fmax-vis3 \
+ s_fmaf-vis3 s_fma-vis3
+sysdep_routines += s_copysignf-vis3 s_copysign-vis3
+endif
+endif
diff --git a/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceil-vis3.S b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceil-vis3.S
new file mode 100644
index 000000000..be41219ce
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceil-vis3.S
@@ -0,0 +1,78 @@
+/* ceil function, sparc32 v9 vis3 version.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by David S. Miller <davem@davemloft.net>, 2012.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <sysdep.h>
+
+ /* Since changing the rounding mode is extremely expensive, we
+ try to round up using a method that is rounding mode
+ agnostic.
+
+ We add then subtract (or subtract than add if the initial
+ value was negative) 2**23 to the value, then subtract it
+ back out.
+
+ This will clear out the fractional portion of the value.
+ One of two things will happen for non-whole initial values.
+ Either the rounding mode will round it up, or it will be
+ rounded down. If the value started out whole, it will be
+ equal after the addition and subtraction. This means we
+ can accurately detect with one test whether we need to add
+ another 1.0 to round it up properly.
+
+ VIS instructions are used to facilitate the formation of
+ easier constants, and the propagation of the sign bit. */
+
+#define TWO_FIFTYTWO 0x43300000 /* 2**52 */
+#define ONE_DOT_ZERO 0x3ff00000 /* 1.0 */
+
+#define ZERO %f10 /* 0.0 */
+#define SIGN_BIT %f12 /* -0.0 */
+
+ENTRY (__ceil_vis3)
+ sethi %hi(TWO_FIFTYTWO), %o2
+ sllx %o0, 32, %o0
+ sethi %hi(ONE_DOT_ZERO), %o3
+ or %o0, %o1, %o0
+ movxtod %o0, %f0
+ sllx %o2, 32, %o2
+ fzero ZERO
+ sllx %o3, 32, %o3
+
+ fnegd ZERO, SIGN_BIT
+
+ movxtod %o2, %f16
+ fabsd %f0, %f14
+
+ fcmpd %fcc3, %f14, %f16
+
+ fmovduge %fcc3, ZERO, %f16
+ fand %f0, SIGN_BIT, SIGN_BIT
+
+ for %f16, SIGN_BIT, %f16
+ faddd %f0, %f16, %f18
+ fsubd %f18, %f16, %f18
+ fcmpd %fcc2, %f18, %f0
+ movxtod %o3, %f20
+
+ fmovduge %fcc2, ZERO, %f20
+ faddd %f18, %f20, %f0
+ fabsd %f0, %f0
+ retl
+ for %f0, SIGN_BIT, %f0
+END (__ceil_vis3)
diff --git a/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceil.S b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceil.S
new file mode 100644
index 000000000..fa4c7c353
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceil.S
@@ -0,0 +1,12 @@
+#include <sparc-ifunc.h>
+
+SPARC_ASM_VIS3_IFUNC(ceil)
+
+weak_alias (__ceil, ceil)
+
+# undef weak_alias
+# define weak_alias(a, b)
+
+#define __ceil __ceil_generic
+
+#include "../s_ceil.S"
diff --git a/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceilf-vis3.S b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceilf-vis3.S
new file mode 100644
index 000000000..c35a85f24
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceilf-vis3.S
@@ -0,0 +1,74 @@
+/* Float ceil function, sparc32 v9 vis3 version.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by David S. Miller <davem@davemloft.net>, 2012.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <sysdep.h>
+
+ /* Since changing the rounding mode is extremely expensive, we
+ try to round up using a method that is rounding mode
+ agnostic.
+
+ We add then subtract (or subtract than add if the initial
+ value was negative) 2**23 to the value, then subtract it
+ back out.
+
+ This will clear out the fractional portion of the value.
+ One of two things will happen for non-whole initial values.
+ Either the rounding mode will round it up, or it will be
+ rounded down. If the value started out whole, it will be
+ equal after the addition and subtraction. This means we
+ can accurately detect with one test whether we need to add
+ another 1.0 to round it up properly.
+
+ VIS instructions are used to facilitate the formation of
+ easier constants, and the propagation of the sign bit. */
+
+#define TWO_TWENTYTHREE 0x4b000000 /* 2**23 */
+#define ONE_DOT_ZERO 0x3f800000 /* 1.0 */
+
+#define ZERO %f10 /* 0.0 */
+#define SIGN_BIT %f12 /* -0.0 */
+
+ENTRY (__ceilf_vis3)
+ movwtos %o0, %f0
+ sethi %hi(TWO_TWENTYTHREE), %o2
+ sethi %hi(ONE_DOT_ZERO), %o3
+ fzeros ZERO
+
+ fnegs ZERO, SIGN_BIT
+
+ movwtos %o2, %f16
+ fabss %f0, %f14
+
+ fcmps %fcc3, %f14, %f16
+
+ fmovsuge %fcc3, ZERO, %f16
+ fands %f0, SIGN_BIT, SIGN_BIT
+
+ fors %f16, SIGN_BIT, %f16
+ fadds %f0, %f16, %f1
+ fsubs %f1, %f16, %f1
+ fcmps %fcc2, %f1, %f0
+ movwtos %o3, %f9
+
+ fmovsuge %fcc2, ZERO, %f9
+ fadds %f1, %f9, %f0
+ fabss %f0, %f0
+ retl
+ fors %f0, SIGN_BIT, %f0
+END (__ceilf_vis3)
diff --git a/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceilf.S b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceilf.S
new file mode 100644
index 000000000..3047dd8fa
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceilf.S
@@ -0,0 +1,12 @@
+#include <sparc-ifunc.h>
+
+SPARC_ASM_VIS3_IFUNC(ceilf)
+
+weak_alias (__ceilf, ceilf)
+
+# undef weak_alias
+# define weak_alias(a, b)
+
+#define __ceilf __ceilf_generic
+
+#include "../s_ceilf.S"
diff --git a/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysign-vis3.S b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysign-vis3.S
new file mode 100644
index 000000000..db27bb7f5
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysign-vis3.S
@@ -0,0 +1,30 @@
+/* copysign function, sparc32 vis3 version.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by David S. Miller <davem@davemloft.net>, 2012.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <sysdep.h>
+
+ENTRY (__copysign_vis3)
+ sethi %hi(0x80000000), %g1
+ and %o2, %g1, %o4
+ andn %o0, %g1, %o0
+ or %o0, %o4, %o0
+ movwtos %o0, %f0
+ retl
+ movwtos %o1, %f1
+END (__copysign_vis3)
diff --git a/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysign.S b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysign.S
new file mode 100644
index 000000000..cdd98c00f
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysign.S
@@ -0,0 +1,12 @@
+#include <sparc-ifunc.h>
+
+SPARC_ASM_VIS3_IFUNC(copysign)
+
+weak_alias (__copysign, copysign)
+
+# undef weak_alias
+# define weak_alias(a, b)
+
+#define __copysign __copysign_generic
+
+#include "../../../fpu/s_copysign.S"
diff --git a/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysignf-vis3.S b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysignf-vis3.S
new file mode 100644
index 000000000..7cdc54084
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysignf-vis3.S
@@ -0,0 +1,29 @@
+/* float copysign function, sparc32 vis3 version.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by David S. Miller <davem@davemloft.net>, 2012.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <sysdep.h>
+
+ENTRY (__copysignf_vis3)
+ sethi %hi(0x80000000), %g1
+ and %o1, %g1, %o4
+ andn %o0, %g1, %o0
+ or %o0, %o4, %o0
+ retl
+ movwtos %o0, %f0
+END (__copysignf_vis3)
diff --git a/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysignf.S b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysignf.S
new file mode 100644
index 000000000..cd409550d
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysignf.S
@@ -0,0 +1,12 @@
+#include <sparc-ifunc.h>
+
+SPARC_ASM_VIS3_IFUNC(copysignf)
+
+weak_alias (__copysignf, copysignf)
+
+# undef weak_alias
+# define weak_alias(a, b)
+
+#define __copysignf __copysignf_generic
+
+#include "../../../fpu/s_copysignf.S"
diff --git a/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabs-vis3.S b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabs-vis3.S
new file mode 100644
index 000000000..733ec90e4
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabs-vis3.S
@@ -0,0 +1,26 @@
+/* Float absolute value, sparc32+v9 vis3 version.
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <sysdep.h>
+
+ENTRY (__fabs_vis3)
+ movwtos %o0, %f0
+ movwtos %o1, %f1
+ retl
+ fabsd %f0, %f0
+END (__fabs_vis3)
diff --git a/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabs.S b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabs.S
new file mode 100644
index 000000000..86c63989a
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabs.S
@@ -0,0 +1,12 @@
+#include <sparc-ifunc.h>
+
+SPARC_ASM_VIS3_IFUNC(fabs)
+
+weak_alias (__fabs, fabs)
+
+# undef weak_alias
+# define weak_alias(a, b)
+
+#define __fabs __fabs_generic
+
+#include "../s_fabs.S"
diff --git a/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabsf-vis3.S b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabsf-vis3.S
new file mode 100644
index 000000000..82b577580
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabsf-vis3.S
@@ -0,0 +1,26 @@
+/* Float absolute value, sparc32 vis3 version.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Jakub Jelinek <jakub@redhat.com>, 2006.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy 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 (__fabsf_vis3)
+ movwtos %o0, %f0
+ retl
+ fabss %f0, %f0
+END (__fabsf_vis3)
diff --git a/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabsf.S b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabsf.S
new file mode 100644
index 000000000..0f2e11e01
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabsf.S
@@ -0,0 +1,12 @@
+#include <sparc-ifunc.h>
+
+SPARC_ASM_VIS3_IFUNC(fabsf)
+
+weak_alias (__fabsf, fabsf)
+
+# undef weak_alias
+# define weak_alias(a, b)
+
+#define __fabsf __fabsf_generic
+
+#include "../../../fpu/s_fabsf.S"
diff --git a/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floor-vis3.S b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floor-vis3.S
new file mode 100644
index 000000000..d7e5d24c1
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floor-vis3.S
@@ -0,0 +1,79 @@
+/* floor function, sparc32 v9 vis3 version.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by David S. Miller <davem@davemloft.net>, 2012.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <sysdep.h>
+
+ /* Since changing the rounding mode is extremely expensive, we
+ try to round up using a method that is rounding mode
+ agnostic.
+
+ We add then subtract (or subtract than add if the initial
+ value was negative) 2**23 to the value, then subtract it
+ back out.
+
+ This will clear out the fractional portion of the value.
+ One of two things will happen for non-whole initial values.
+ Either the rounding mode will round it up, or it will be
+ rounded down. If the value started out whole, it will be
+ equal after the addition and subtraction. This means we
+ can accurately detect with one test whether we need to add
+ another 1.0 to round it up properly.
+
+ VIS instructions are used to facilitate the formation of
+ easier constants, and the propagation of the sign bit. */
+
+#define TWO_FIFTYTWO 0x43300000 /* 2**52 */
+#define ONE_DOT_ZERO 0x3ff00000 /* 1.0 */
+
+#define ZERO %f10 /* 0.0 */
+#define SIGN_BIT %f12 /* -0.0 */
+
+ENTRY (__floor_vis3)
+ sethi %hi(TWO_FIFTYTWO), %o2
+ sllx %o0, 32, %o0
+ sethi %hi(ONE_DOT_ZERO), %o3
+ or %o0, %o1, %o0
+ movxtod %o0, %f0
+ sllx %o2, 32, %o2
+ fzero ZERO
+ sllx %o3, 32, %o3
+
+ fnegd ZERO, SIGN_BIT
+
+ stx %o2, [%sp + 72]
+ fabsd %f0, %f14
+
+ ldd [%sp + 72], %f16
+ fcmpd %fcc3, %f14, %f16
+
+ fmovduge %fcc3, ZERO, %f16
+ fand %f0, SIGN_BIT, SIGN_BIT
+
+ for %f16, SIGN_BIT, %f16
+ faddd %f0, %f16, %f18
+ fsubd %f18, %f16, %f18
+ fcmpd %fcc2, %f18, %f0
+ movxtod %o3, %f20
+
+ fmovdule %fcc2, ZERO, %f20
+ fsubd %f18, %f20, %f0
+ fabsd %f0, %f0
+ retl
+ for %f0, SIGN_BIT, %f0
+END (__floor_vis3)
diff --git a/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floor.S b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floor.S
new file mode 100644
index 000000000..6ae9947a7
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floor.S
@@ -0,0 +1,12 @@
+#include <sparc-ifunc.h>
+
+SPARC_ASM_VIS3_IFUNC(floor)
+
+weak_alias (__floor, floor)
+
+# undef weak_alias
+# define weak_alias(a, b)
+
+#define __floor __floor_generic
+
+#include "../s_floor.S"
diff --git a/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floorf-vis3.S b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floorf-vis3.S
new file mode 100644
index 000000000..24c8764fa
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floorf-vis3.S
@@ -0,0 +1,74 @@
+/* Float floor function, sparc32 v9 vis3 version.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by David S. Miller <davem@davemloft.net>, 2012.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <sysdep.h>
+
+ /* Since changing the rounding mode is extremely expensive, we
+ try to round up using a method that is rounding mode
+ agnostic.
+
+ We add then subtract (or subtract than add if the initial
+ value was negative) 2**23 to the value, then subtract it
+ back out.
+
+ This will clear out the fractional portion of the value.
+ One of two things will happen for non-whole initial values.
+ Either the rounding mode will round it up, or it will be
+ rounded down. If the value started out whole, it will be
+ equal after the addition and subtraction. This means we
+ can accurately detect with one test whether we need to add
+ another 1.0 to round it up properly.
+
+ VIS instructions are used to facilitate the formation of
+ easier constants, and the propagation of the sign bit. */
+
+#define TWO_TWENTYTHREE 0x4b000000 /* 2**23 */
+#define ONE_DOT_ZERO 0x3f800000 /* 1.0 */
+
+#define ZERO %f10 /* 0.0 */
+#define SIGN_BIT %f12 /* -0.0 */
+
+ENTRY (__floorf_vis3)
+ movwtos %o0, %f0
+ sethi %hi(TWO_TWENTYTHREE), %o2
+ sethi %hi(ONE_DOT_ZERO), %o3
+ fzeros ZERO
+
+ fnegs ZERO, SIGN_BIT
+
+ movwtos %o2, %f16
+ fabss %f0, %f14
+
+ fcmps %fcc3, %f14, %f16
+
+ fmovsuge %fcc3, ZERO, %f16
+ fands %f0, SIGN_BIT, SIGN_BIT
+
+ fors %f16, SIGN_BIT, %f16
+ fadds %f0, %f16, %f1
+ fsubs %f1, %f16, %f1
+ fcmps %fcc2, %f1, %f0
+ movwtos %o3, %f9
+
+ fmovsule %fcc2, ZERO, %f9
+ fsubs %f1, %f9, %f0
+ fabss %f0, %f0
+ retl
+ fors %f0, SIGN_BIT, %f0
+END (__floorf_vis3)
diff --git a/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floorf.S b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floorf.S
new file mode 100644
index 000000000..31cda385b
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floorf.S
@@ -0,0 +1,12 @@
+#include <sparc-ifunc.h>
+
+SPARC_ASM_VIS3_IFUNC(floorf)
+
+weak_alias (__floorf, floorf)
+
+# undef weak_alias
+# define weak_alias(a, b)
+
+#define __floorf __floorf_generic
+
+#include "../s_floorf.S"
diff --git a/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fma-vis3.S b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fma-vis3.S
new file mode 100644
index 000000000..ee2790023
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fma-vis3.S
@@ -0,0 +1,31 @@
+/* fma function, sparc32 vis3 version.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by David S. Miller <davem@davemloft.net>, 2012.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <sysdep.h>
+
+ENTRY (__fma_vis3)
+ movwtos %o0, %f0
+ movwtos %o1, %f1
+ movwtos %o2, %f2
+ movwtos %o3, %f3
+ movwtos %o4, %f4
+ movwtos %o5, %f5
+ retl
+ fmaddd %f0, %f2, %f4, %f0
+END (__fma_vis3)
diff --git a/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fma.c b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fma.c
new file mode 100644
index 000000000..3f2f1622c
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fma.c
@@ -0,0 +1,14 @@
+#ifdef HAVE_AS_VIS3_SUPPORT
+# include <sparc-ifunc.h>
+# include <math.h>
+
+extern double __fma_vis3 (double, double, double);
+extern double __fma_generic (double, double, double);
+
+sparc_libm_ifunc(__fma, hwcap & HWCAP_SPARC_FMAF ? __fma_vis3 : __fma_generic);
+weak_alias (__fma, fma)
+
+# define __fma __fma_generic
+#endif
+
+#include <sysdeps/ieee754/dbl-64/s_fma.c>
diff --git a/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmaf-vis3.S b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmaf-vis3.S
new file mode 100644
index 000000000..1a934f614
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmaf-vis3.S
@@ -0,0 +1,28 @@
+/* fmaf function, sparc32 vis3 version.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by David S. Miller <davem@davemloft.net>, 2012.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <sysdep.h>
+
+ENTRY (__fmaf_vis3)
+ movwtos %o0, %f1
+ movwtos %o1, %f3
+ movwtos %o2, %f5
+ retl
+ fmadds %f1, %f3, %f5, %f0
+END (__fmaf_vis3)
diff --git a/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmaf.c b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmaf.c
new file mode 100644
index 000000000..7a273a3b1
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmaf.c
@@ -0,0 +1,14 @@
+#ifdef HAVE_AS_VIS3_SUPPORT
+# include <sparc-ifunc.h>
+# include <math.h>
+
+extern float __fmaf_vis3 (float, float, float);
+extern float __fmaf_generic (float, float, float);
+
+sparc_libm_ifunc(__fmaf, hwcap & HWCAP_SPARC_FMAF ? __fmaf_vis3 : __fmaf_generic);
+weak_alias (__fmaf, fmaf)
+
+# define __fmaf __fmaf_generic
+#endif
+
+#include <sysdeps/ieee754/dbl-64/s_fmaf.c>
diff --git a/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmax-vis3.S b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmax-vis3.S
new file mode 100644
index 000000000..9fdee2c4c
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmax-vis3.S
@@ -0,0 +1,30 @@
+/* fmax function, sparc32 vis3 version.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by David S. Miller <davem@davemloft.net>, 2012.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <sysdep.h>
+
+ENTRY (__fmax_vis3)
+ movwtos %o0, %f0
+ movwtos %o1, %f1
+ movwtos %o2, %f2
+ movwtos %o3, %f3
+ flcmpd %fcc1, %f0, %f2
+ retl
+ fmovdlg %fcc1, %f2, %f0
+END (__fmax_vis3)
diff --git a/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmax.S b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmax.S
new file mode 100644
index 000000000..d5e59d8d1
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmax.S
@@ -0,0 +1,12 @@
+#include <sparc-ifunc.h>
+
+SPARC_ASM_VIS3_IFUNC(fmax)
+
+weak_alias (__fmax, fmax)
+
+# undef weak_alias
+# define weak_alias(a, b)
+
+#define __fmax __fmax_generic
+
+#include "../s_fmax.S"
diff --git a/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmaxf-vis3.S b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmaxf-vis3.S
new file mode 100644
index 000000000..731a04aef
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmaxf-vis3.S
@@ -0,0 +1,28 @@
+/* fmaxf function, sparc32 vis3 version.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by David S. Miller <davem@davemloft.net>, 2012.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <sysdep.h>
+
+ENTRY (__fmaxf_vis3)
+ movwtos %o0, %f0
+ movwtos %o1, %f1
+ flcmps %fcc1, %f0, %f1
+ retl
+ fmovslg %fcc1, %f1, %f0
+END (__fmaxf_vis3)
diff --git a/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmaxf.S b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmaxf.S
new file mode 100644
index 000000000..daa91579c
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmaxf.S
@@ -0,0 +1,12 @@
+#include <sparc-ifunc.h>
+
+SPARC_ASM_VIS3_IFUNC(fmaxf)
+
+weak_alias (__fmaxf, fmaxf)
+
+# undef weak_alias
+# define weak_alias(a, b)
+
+#define __fmaxf __fmaxf_generic
+
+#include "../s_fmaxf.S"
diff --git a/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmin-vis3.S b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmin-vis3.S
new file mode 100644
index 000000000..54c32bd5b
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmin-vis3.S
@@ -0,0 +1,30 @@
+/* fmin function, sparc32 vis3 version.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by David S. Miller <davem@davemloft.net>, 2012.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <sysdep.h>
+
+ENTRY (__fmin_vis3)
+ movwtos %o0, %f0
+ movwtos %o1, %f1
+ movwtos %o2, %f2
+ movwtos %o3, %f3
+ flcmpd %fcc1, %f0, %f2
+ retl
+ fmovdge %fcc1, %f2, %f0
+END (__fmin_vis3)
diff --git a/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmin.S b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmin.S
new file mode 100644
index 000000000..b2aec1bbc
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmin.S
@@ -0,0 +1,12 @@
+#include <sparc-ifunc.h>
+
+SPARC_ASM_VIS3_IFUNC(fmin)
+
+weak_alias (__fmin, fmin)
+
+# undef weak_alias
+# define weak_alias(a, b)
+
+#define __fmin __fmin_generic
+
+#include "../s_fmin.S"
diff --git a/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fminf-vis3.S b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fminf-vis3.S
new file mode 100644
index 000000000..a13f33238
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fminf-vis3.S
@@ -0,0 +1,28 @@
+/* fminf function, sparc32 vis3 version.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by David S. Miller <davem@davemloft.net>, 2012.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <sysdep.h>
+
+ENTRY (__fminf_vis3)
+ movwtos %o0, %f0
+ movwtos %o1, %f1
+ flcmps %fcc1, %f0, %f1
+ retl
+ fmovsge %fcc1, %f1, %f0
+END (__fminf_vis3)
diff --git a/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fminf.S b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fminf.S
new file mode 100644
index 000000000..c4690e1df
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fminf.S
@@ -0,0 +1,12 @@
+#include <sparc-ifunc.h>
+
+SPARC_ASM_VIS3_IFUNC(fminf)
+
+weak_alias (__fminf, fminf)
+
+# undef weak_alias
+# define weak_alias(a, b)
+
+#define __fminf __fminf_generic
+
+#include "../s_fminf.S"
diff --git a/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrint-vis3.S b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrint-vis3.S
new file mode 100644
index 000000000..8a90722b5
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrint-vis3.S
@@ -0,0 +1,58 @@
+/* llrint(), sparc32 v9 vis3 version.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by David S. Miller <davem@davemloft.net>, 2012.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <sysdep.h>
+
+ /* VIS instructions are used to facilitate the formation of
+ easier constants, and the propagation of the sign bit. */
+
+#define TWO_FIFTYTWO 0x43300000 /* 2**52 */
+
+#define ZERO %f10 /* 0.0 */
+#define SIGN_BIT %f12 /* -0.0 */
+
+ENTRY (__llrint_vis3)
+ sethi %hi(TWO_FIFTYTWO), %o2
+ sllx %o0, 32, %o0
+
+ or %o0, %o1, %o0
+ fzero ZERO
+
+ movxtod %o0, %f0
+ sllx %o2, 32, %o2
+ fnegd ZERO, SIGN_BIT
+
+ movxtod %o2, %f16
+ fabsd %f0, %f14
+
+ fcmpd %fcc3, %f14, %f16
+
+ fmovduge %fcc3, ZERO, %f16
+ fand %f0, SIGN_BIT, SIGN_BIT
+
+ for %f16, SIGN_BIT, %f16
+ faddd %f0, %f16, %f6
+ fsubd %f6, %f16, %f0
+ fabsd %f0, %f0
+ for %f0, SIGN_BIT, %f0
+ fdtox %f0, %f4
+ movstouw %f4, %o0
+ retl
+ movstouw %f5, %o1
+END (__llrint_vis3)
diff --git a/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrint.S b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrint.S
new file mode 100644
index 000000000..a904aeca2
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrint.S
@@ -0,0 +1,17 @@
+#include <sparc-ifunc.h>
+
+SPARC_ASM_VIS3_IFUNC(llrint)
+
+weak_alias (__llrint, llrint)
+
+strong_alias (__llrint, __lllrint)
+weak_alias (__lllrint, lllrint)
+
+# undef weak_alias
+# define weak_alias(a, b)
+# undef strong_alias
+# define strong_alias(a, b)
+
+#define __llrint __llrint_generic
+
+#include "../s_llrint.S"
diff --git a/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrintf-vis3.S b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrintf-vis3.S
new file mode 100644
index 000000000..8590af2bb
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrintf-vis3.S
@@ -0,0 +1,54 @@
+/* llrintf(), sparc32 v9 vis3 version.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by David S. Miller <davem@davemloft.net>, 2012.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <sysdep.h>
+
+ /* VIS instructions are used to facilitate the formation of
+ easier constants, and the propagation of the sign bit. */
+
+#define TWO_TWENTYTHREE 0x4b000000 /* 2**23 */
+
+#define ZERO %f10 /* 0.0 */
+#define SIGN_BIT %f12 /* -0.0 */
+
+ENTRY (__llrintf_vis3)
+ movwtos %o0, %f1
+ sethi %hi(TWO_TWENTYTHREE), %o2
+ fzeros ZERO
+
+ fnegs ZERO, SIGN_BIT
+
+ movwtos %o2, %f16
+ fabss %f1, %f14
+
+ fcmps %fcc3, %f14, %f16
+
+ fmovsuge %fcc3, ZERO, %f16
+ fands %f1, SIGN_BIT, SIGN_BIT
+
+ fors %f16, SIGN_BIT, %f16
+ fadds %f1, %f16, %f5
+ fsubs %f5, %f16, %f0
+ fabss %f0, %f0
+ fors %f0, SIGN_BIT, %f0
+ fstox %f0, %f4
+ movstouw %f4, %o0
+ retl
+ movstouw %f5, %o1
+END (__llrintf_vis3)
diff --git a/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrintf.S b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrintf.S
new file mode 100644
index 000000000..8af5244e7
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrintf.S
@@ -0,0 +1,17 @@
+#include <sparc-ifunc.h>
+
+SPARC_ASM_VIS3_IFUNC(llrintf)
+
+weak_alias (__llrintf, llrintf)
+
+strong_alias (__llrintf, __lllrintf)
+weak_alias (__lllrintf, lllrintf)
+
+# undef weak_alias
+# define weak_alias(a, b)
+# undef strong_alias
+# define strong_alias(a, b)
+
+#define __llrintf __llrintf_generic
+
+#include "../s_llrintf.S"
diff --git a/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rint-vis3.S b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rint-vis3.S
new file mode 100644
index 000000000..6c4a3e00d
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rint-vis3.S
@@ -0,0 +1,55 @@
+/* Round float to int floating-point values, sparc32 v9 vis3 version.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by David S. Miller <davem@davemloft.net>, 2012.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <sysdep.h>
+
+ /* VIS instructions are used to facilitate the formation of
+ easier constants, and the propagation of the sign bit. */
+
+#define TWO_FIFTYTWO 0x43300000 /* 2**52 */
+
+#define ZERO %f10 /* 0.0 */
+#define SIGN_BIT %f12 /* -0.0 */
+
+ENTRY (__rint_vis3)
+ sethi %hi(TWO_FIFTYTWO), %o2
+ sllx %o0, 32, %o0
+
+ or %o0, %o1, %o0
+ fzero ZERO
+
+ movxtod %o0, %f0
+ sllx %o2, 32, %o2
+ fnegd ZERO, SIGN_BIT
+
+ movxtod %o2, %f16
+ fabsd %f0, %f14
+
+ fcmpd %fcc3, %f14, %f16
+
+ fmovduge %fcc3, ZERO, %f16
+ fand %f0, SIGN_BIT, SIGN_BIT
+
+ for %f16, SIGN_BIT, %f16
+ faddd %f0, %f16, %f6
+ fsubd %f6, %f16, %f0
+ fabsd %f0, %f0
+ retl
+ for %f0, SIGN_BIT, %f0
+END (__rint_vis3)
diff --git a/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rint.S b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rint.S
new file mode 100644
index 000000000..cc980eb8c
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rint.S
@@ -0,0 +1,12 @@
+#include <sparc-ifunc.h>
+
+SPARC_ASM_VIS3_IFUNC(rint)
+
+weak_alias (__rint, rint)
+
+# undef weak_alias
+# define weak_alias(a, b)
+
+#define __rint __rint_generic
+
+#include "../s_rint.S"
diff --git a/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rintf-vis3.S b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rintf-vis3.S
new file mode 100644
index 000000000..ec0bb37b1
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rintf-vis3.S
@@ -0,0 +1,51 @@
+/* Round float to int floating-point values, sparc32 v9 vis3 version.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by David S. Miller <davem@davemloft.net>, 2012.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <sysdep.h>
+
+ /* VIS instructions are used to facilitate the formation of
+ easier constants, and the propagation of the sign bit. */
+
+#define TWO_TWENTYTHREE 0x4b000000 /* 2**23 */
+
+#define ZERO %f10 /* 0.0 */
+#define SIGN_BIT %f12 /* -0.0 */
+
+ENTRY (__rintf_vis3)
+ movwtos %o0, %f1
+ sethi %hi(TWO_TWENTYTHREE), %o2
+ fzeros ZERO
+
+ fnegs ZERO, SIGN_BIT
+
+ movwtos %o2, %f16
+ fabss %f1, %f14
+
+ fcmps %fcc3, %f14, %f16
+
+ fmovsuge %fcc3, ZERO, %f16
+ fands %f1, SIGN_BIT, SIGN_BIT
+
+ fors %f16, SIGN_BIT, %f16
+ fadds %f1, %f16, %f5
+ fsubs %f5, %f16, %f0
+ fabss %f0, %f0
+ retl
+ fors %f0, SIGN_BIT, %f0
+END (__rintf_vis3)
diff --git a/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rintf.S b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rintf.S
new file mode 100644
index 000000000..38fd93608
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rintf.S
@@ -0,0 +1,12 @@
+#include <sparc-ifunc.h>
+
+SPARC_ASM_VIS3_IFUNC(rintf)
+
+weak_alias (__rintf, rintf)
+
+# undef weak_alias
+# define weak_alias(a, b)
+
+#define __rintf __rintf_generic
+
+#include "../s_rintf.S"
diff --git a/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/w_sqrt-vis3.S b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/w_sqrt-vis3.S
new file mode 100644
index 000000000..3880da0d8
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/w_sqrt-vis3.S
@@ -0,0 +1,49 @@
+/* sqrt function. sparc32 v9 vis3 version.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <sysdep.h>
+
+ENTRY (__sqrt_vis3)
+ movwtos %o0, %f0
+ fzero %f8
+ movwtos %o1, %f1
+ fcmpd %f0, %f8
+ fbl 1f
+ nop
+8: retl
+ fsqrtd %f0, %f0
+1:
+#ifdef SHARED
+ SETUP_PIC_REG_LEAF(o5, g1)
+ sethi %gdop_hix22(_LIB_VERSION), %g1
+ xor %g1, %gdop_lox10(_LIB_VERSION), %g1
+ ld [%o5 + %g1], %g1, %gdop(_LIB_VERSION)
+#else
+ sethi %hi(_LIB_VERSION), %g1
+ or %g1, %lo(_LIB_VERSION), %g1
+#endif
+ ld [%g1], %g1
+ cmp %g1, -1
+ be 8b
+ mov %o0, %o2
+ mov %o1, %o3
+ mov 26, %o4
+ mov %o7, %g1
+ call __kernel_standard
+ mov %g1, %o7
+END (__sqrt_vis3)
diff --git a/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/w_sqrt.S b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/w_sqrt.S
new file mode 100644
index 000000000..3b070721d
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/w_sqrt.S
@@ -0,0 +1,12 @@
+#include <sparc-ifunc.h>
+
+SPARC_ASM_VIS3_IFUNC(sqrt)
+
+weak_alias (__sqrt, sqrt)
+
+# undef weak_alias
+# define weak_alias(a, b)
+
+#define __sqrt __sqrt_generic
+
+#include "../w_sqrt.S"
diff --git a/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/w_sqrtf-vis3.S b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/w_sqrtf-vis3.S
new file mode 100644
index 000000000..2d4270f9c
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/w_sqrtf-vis3.S
@@ -0,0 +1,47 @@
+/* sqrtf function. sparc32 v9 vis3 version.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <sysdep.h>
+
+ENTRY (__sqrtf_vis3)
+ movwtos %o0, %f0
+ fzeros %f8
+ fcmps %f0, %f8
+ fbl 1f
+ nop
+8: retl
+ fsqrts %f0, %f0
+1:
+#ifdef SHARED
+ SETUP_PIC_REG_LEAF(o5, g1)
+ sethi %gdop_hix22(_LIB_VERSION), %g1
+ xor %g1, %gdop_lox10(_LIB_VERSION), %g1
+ ld [%o5 + %g1], %g1, %gdop(_LIB_VERSION)
+#else
+ sethi %hi(_LIB_VERSION), %g1
+ or %g1, %lo(_LIB_VERSION), %g1
+#endif
+ ld [%g1], %g1
+ cmp %g1, -1
+ be 8b
+ mov %o0, %o1
+ mov 126, %o2
+ mov %o7, %g1
+ call __kernel_standard_f
+ mov %g1, %o7
+END (__sqrtf_vis3)
diff --git a/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/w_sqrtf.S b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/w_sqrtf.S
new file mode 100644
index 000000000..777a04058
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/w_sqrtf.S
@@ -0,0 +1,12 @@
+#include <sparc-ifunc.h>
+
+SPARC_ASM_VIS3_IFUNC(sqrtf)
+
+weak_alias (__sqrtf, sqrtf)
+
+# undef weak_alias
+# define weak_alias(a, b)
+
+#define __sqrtf __sqrtf_generic
+
+#include "../w_sqrtf.S"
diff --git a/libc/sysdeps/x86_64/fpu/s_sincosl.S b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/s_fmax.S
index b394c04ca..351eaaca6 100644
--- a/libc/sysdeps/x86_64/fpu/s_sincosl.S
+++ b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/s_fmax.S
@@ -1,7 +1,7 @@
-/* Compute sine and cosine of argument.
- Copyright (C) 1997, 2000, 2001, 2005 Free Software Foundation, Inc.
+/* fmax function, sparc32 v9 version.
+ Copyright (C) 2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
+ Contributed by David S. Miller <davem@davemloft.net>, 2012.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -17,43 +17,24 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <machine/asm.h>
-#include "bp-sym.h"
-#include "bp-asm.h"
-
-#define PARMS LINKAGE /* no space for saved regs */
-#define ANGLE PARMS
-#define SINP ANGLE+12
-#define COSP SINP+PTR_SIZE
-
- .text
-ENTRY (BP_SYM (__sincosl))
- ENTER
-
- fldt 8(%rsp)
- fsincos
- fnstsw %ax
- testl $0x400,%eax
- jnz 1f
- fstpt (%rsi)
- fstpt (%rdi)
-
- LEAVE
- retq
-
-1: fldpi
- fadd %st(0)
- fxch %st(1)
-2: fprem1
- fnstsw %ax
- testl $0x400,%eax
- jnz 2b
- fstp %st(1)
- fsincos
- fstpt (%rsi)
- fstpt (%rdi)
-
- LEAVE
- retq
-END (BP_SYM (__sincosl))
-weak_alias (BP_SYM (__sincosl), BP_SYM (sincosl))
+#include <sysdep.h>
+
+#define SIGN_BIT %f12 /* -0.0 */
+
+ENTRY (__fmax)
+ std %o0, [%sp + 72]
+ std %o2, [%sp + 80]
+ ldd [%sp + 72], %f0
+ ldd [%sp + 80], %f2
+ fcmpd %fcc1, %f2, %f2
+ fzero SIGN_BIT
+ fmovdu %fcc1, %f0, %f2
+ fnegd SIGN_BIT, SIGN_BIT
+ fcmpd %fcc2, %f0, %f2
+ fmovdul %fcc2, %f2, %f0
+ fand %f0, %f2, %f4
+ fandnot2 SIGN_BIT, %f4, %f4
+ retl
+ fandnot2 %f0, %f4, %f0
+END (__fmax)
+weak_alias (__fmax, fmax)
diff --git a/libc/sysdeps/sparc/sparc32/sparcv9/fpu/s_fmaxf.S b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/s_fmaxf.S
new file mode 100644
index 000000000..301821056
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/s_fmaxf.S
@@ -0,0 +1,40 @@
+/* fmaxf function, sparc32 v9 version.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by David S. Miller <davem@davemloft.net>, 2012.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <sysdep.h>
+
+#define SIGN_BIT %f12 /* -0.0 */
+
+ENTRY (__fmaxf)
+ st %o0, [%sp + 72]
+ st %o1, [%sp + 76]
+ ld [%sp + 72], %f1
+ ld [%sp + 76], %f3
+ fcmps %fcc1, %f3, %f3
+ fzeros SIGN_BIT
+ fmovsu %fcc1, %f1, %f3
+ fnegs SIGN_BIT, SIGN_BIT
+ fcmps %fcc2, %f1, %f3
+ fmovsul %fcc2, %f3, %f1
+ fands %f1, %f3, %f4
+ fandnot2s SIGN_BIT, %f4, %f4
+ retl
+ fandnot2s %f1, %f4, %f0
+END (__fmaxf)
+weak_alias (__fmaxf, fmaxf)
diff --git a/libc/sysdeps/sparc/sparc32/sparcv9/fpu/s_fmin.S b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/s_fmin.S
new file mode 100644
index 000000000..059f15a61
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/s_fmin.S
@@ -0,0 +1,40 @@
+/* fmin function, sparc32 v9 version.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by David S. Miller <davem@davemloft.net>, 2012.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <sysdep.h>
+
+#define SIGN_BIT %f12 /* -0.0 */
+
+ENTRY (__fmin)
+ std %o0, [%sp + 72]
+ std %o2, [%sp + 80]
+ ldd [%sp + 72], %f0
+ ldd [%sp + 80], %f2
+ fcmpd %fcc1, %f2, %f2
+ fzero SIGN_BIT
+ fmovdu %fcc1, %f0, %f2
+ fnegd SIGN_BIT, SIGN_BIT
+ fcmpd %fcc2, %f0, %f2
+ fmovdug %fcc2, %f2, %f0
+ for %f0, %f2, %f4
+ fand %f4, SIGN_BIT, %f4
+ retl
+ for %f0, %f4, %f0
+END (__fmin)
+weak_alias (__fmin, fmin)
diff --git a/libc/sysdeps/sparc/sparc32/sparcv9/fpu/s_fminf.S b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/s_fminf.S
new file mode 100644
index 000000000..168020bb6
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/s_fminf.S
@@ -0,0 +1,40 @@
+/* fminf function, sparc32 v9 version.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by David S. Miller <davem@davemloft.net>, 2012.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <sysdep.h>
+
+#define SIGN_BIT %f12 /* -0.0 */
+
+ENTRY (__fminf)
+ st %o0, [%sp + 72]
+ st %o1, [%sp + 76]
+ ld [%sp + 72], %f1
+ ld [%sp + 76], %f3
+ fcmps %fcc1, %f3, %f3
+ fzeros SIGN_BIT
+ fmovsu %fcc1, %f1, %f3
+ fnegs SIGN_BIT, SIGN_BIT
+ fcmps %fcc2, %f1, %f3
+ fmovsug %fcc2, %f3, %f1
+ fors %f1, %f3, %f4
+ fands %f4, SIGN_BIT, %f4
+ retl
+ fors %f1, %f4, %f0
+END (__fminf)
+weak_alias (__fminf, fminf)
diff --git a/libc/sysdeps/sparc/sparc32/sparcv9/fpu/unix/sysv/linux/multiarch/Implies b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/unix/sysv/linux/multiarch/Implies
new file mode 100644
index 000000000..a380d8a73
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc32/sparcv9/fpu/unix/sysv/linux/multiarch/Implies
@@ -0,0 +1,4 @@
+# We must list this here to move it ahead of the ldbl-opt code.
+sparc/sparc32/sparcv9/fpu/multiarch
+sparc/sparc32/sparcv9/fpu
+sparc/sparc32/fpu
diff --git a/libc/sysdeps/sparc/sparc32/sparcv9/hp-timing.h b/libc/sysdeps/sparc/sparc32/sparcv9/hp-timing.h
index b90bb8415..d0f896da5 100644
--- a/libc/sysdeps/sparc/sparc32/sparcv9/hp-timing.h
+++ b/libc/sysdeps/sparc/sparc32/sparcv9/hp-timing.h
@@ -22,7 +22,7 @@
#include <string.h>
#include <sys/param.h>
-#include <stdio-common/_itoa.h>
+#include <_itoa.h>
#define HP_TIMING_AVAIL (1)
#define HP_TIMING_INLINE (1)
diff --git a/libc/sysdeps/sparc/sparc64/Makefile b/libc/sysdeps/sparc/sparc64/Makefile
index fb8b011d5..2b7b83035 100644
--- a/libc/sysdeps/sparc/sparc64/Makefile
+++ b/libc/sysdeps/sparc/sparc64/Makefile
@@ -6,3 +6,12 @@ endif
ifeq ($(subdir),string)
sysdep_routines += align-cpy
endif
+
+ifeq ($(have-as-vis3),yes)
+ASFLAGS-.o += -Wa,-Av9d
+ASFLAGS-.os += -Wa,-Av9d
+ASFLAGS-.op += -Wa,-Av9d
+ASFLAGS-.og += -Wa,-Av9d
+ASFLAGS-.ob += -Wa,-Av9d
+ASFLAGS-.oS += -Wa,-Av9d
+endif
diff --git a/libc/sysdeps/sparc/sparc64/dl-trampoline.S b/libc/sysdeps/sparc/sparc64/dl-trampoline.S
index 7caece343..7d74fd0af 100644
--- a/libc/sysdeps/sparc/sparc64/dl-trampoline.S
+++ b/libc/sysdeps/sparc/sparc64/dl-trampoline.S
@@ -1,5 +1,5 @@
/* PLT trampolines. Sparc 64-bit version.
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -158,8 +158,11 @@ _dl_profile_save_regs:
_dl_profile_invoke:
cfi_startproc
- sub %sp, %l0, %sp
-1:
+ add %l0, 7, %l0
+ andn %l0, 7, %l0
+ add %l0, (8 * 8), %g1
+
+ sub %sp, %g1, %sp
srlx %l0, 3, %l7
mov %o0, %l1
mov %i0, %o0
@@ -169,7 +172,8 @@ _dl_profile_invoke:
mov %i4, %o4
mov %i5, %o5
add %fp, STACK_BIAS, %l2
- add %sp, STACK_BIAS, %l3
+ brz %l0, 2f
+ add %sp, STACK_BIAS, %l3
1: ldx [%l2], %l4
add %l2, 0x8, %l2
subcc %l7, 1, %l7
@@ -177,7 +181,7 @@ _dl_profile_invoke:
bne,pt %xcc, 1b
add %l3, 0x8, %l3
- jmpl %l1, %o7
+2: jmpl %l1, %o7
nop
stx %o0, [%sp + STACK_BIAS + (16 * 8)]
@@ -191,15 +195,18 @@ _dl_profile_invoke:
mov %l5, %o0
mov %l6, %o1
- add %sp, %l0, %o2
- add %sp, STACK_BIAS + (16 * 8), %o3
+ add %sp, STACK_BIAS + (24 * 8), %o2
call _dl_call_pltexit
- add %o2, STACK_BIAS, %o2
+ add %sp, STACK_BIAS + (16 * 8), %o3
ldx [%sp + STACK_BIAS + (16 * 8)], %i0
ldx [%sp + STACK_BIAS + (17 * 8)], %i1
ldx [%sp + STACK_BIAS + (18 * 8)], %i2
ldx [%sp + STACK_BIAS + (19 * 8)], %i3
+ ldd [%sp + STACK_BIAS + (20 * 8)], %f0
+ ldd [%sp + STACK_BIAS + (21 * 8)], %f2
+ ldd [%sp + STACK_BIAS + (22 * 8)], %f4
+ ldd [%sp + STACK_BIAS + (23 * 8)], %f8
jmpl %i7 + 8, %g0
restore
@@ -219,10 +226,7 @@ _dl_profile_invoke:
_dl_runtime_profile_0:
cfi_startproc
- brz,a,pn %fp, 1f
- mov 192, %g5
- sub %fp, %sp, %g5
-1: save %sp, -336, %sp
+ save %sp, -336, %sp
cfi_def_cfa_register(%fp)
cfi_window_save
cfi_register(%o7, %i7)
@@ -250,7 +254,6 @@ _dl_runtime_profile_0:
mov %i7, %o2
sllx %l0, 3, %o1
- mov %g5, %l0
mov %o0, %l5
mov %o1, %l6
@@ -261,8 +264,8 @@ _dl_runtime_profile_0:
call _dl_profile_fixup
add %sp, (STACK_BIAS + (32 * 8)), %o4
- ldx [%sp + STACK_BIAS + (32 * 8)], %o1
- brgez,pt %o1, 1f
+ ldx [%sp + STACK_BIAS + (32 * 8)], %l0
+ brlz,pt %l0, 1f
nop
call _dl_profile_invoke
@@ -285,10 +288,7 @@ _dl_runtime_profile_0:
_dl_runtime_profile_1:
cfi_startproc
- brz,a,pn %fp, 1f
- mov 192, %g5
- sub %fp, %sp, %g5
-1: save %sp, -336, %sp
+ save %sp, -336, %sp
cfi_def_cfa_register(%fp)
cfi_window_save
cfi_register(%o7, %i7)
@@ -300,7 +300,6 @@ _dl_runtime_profile_1:
mov %i7, %o2
add %o1, %o3, %o1
- mov %g5, %l0
mov %o0, %l5
mov %o1, %l6
@@ -311,8 +310,8 @@ _dl_runtime_profile_1:
call _dl_profile_fixup
add %sp, (STACK_BIAS + (32 * 8)), %o4
- ldx [%sp + STACK_BIAS + (32 * 8)], %o1
- brgez,pt %o1, 1f
+ ldx [%sp + STACK_BIAS + (32 * 8)], %l0
+ brlz,pt %l0, 1f
nop
call _dl_profile_invoke
diff --git a/libc/sysdeps/sparc/sparc64/fpu/multiarch/Makefile b/libc/sysdeps/sparc/sparc64/fpu/multiarch/Makefile
new file mode 100644
index 000000000..83458484a
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc64/fpu/multiarch/Makefile
@@ -0,0 +1,15 @@
+ifeq ($(subdir),math)
+ifeq ($(have-as-vis3),yes)
+libm-sysdep_routines += m_signbitf-vis3 m_signbit-vis3 s_ceilf-vis3 \
+ s_ceil-vis3 m_finitef-vis3 m_finite-vis3 \
+ s_floorf-vis3 s_floor-vis3 m_isinff-vis3 \
+ m_isinf-vis3 m_isnanf-vis3 m_isnan-vis3 \
+ s_lrintf-vis3 s_lrint-vis3 s_rintf-vis3 \
+ s_rint-vis3 s_fminf-vis3 s_fmin-vis3 \
+ s_fmaxf-vis3 s_fmax-vis3 s_fmaf-vis3 \
+ s_fma-vis3
+sysdep_routines += s_signbitf-vis3 s_signbit-vis3 s_finitef-vis3 \
+ s_finite-vis3 s_isinff-vis3 s_isinf-vis3 \
+ s_isnanf-vis3 s_isnan-vis3
+endif
+endif
diff --git a/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil-vis3.S b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil-vis3.S
new file mode 100644
index 000000000..ebf9d80b8
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil-vis3.S
@@ -0,0 +1,75 @@
+/* ceil function, sparc64 vis3 version.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by David S. Miller <davem@davemloft.net>, 2012.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <sysdep.h>
+
+ /* Since changing the rounding mode is extremely expensive, we
+ try to round up using a method that is rounding mode
+ agnostic.
+
+ We add then subtract (or subtract than add if the initial
+ value was negative) 2**23 to the value, then subtract it
+ back out.
+
+ This will clear out the fractional portion of the value.
+ One of two things will happen for non-whole initial values.
+ Either the rounding mode will round it up, or it will be
+ rounded down. If the value started out whole, it will be
+ equal after the addition and subtraction. This means we
+ can accurately detect with one test whether we need to add
+ another 1.0 to round it up properly.
+
+ VIS instructions are used to facilitate the formation of
+ easier constants, and the propagation of the sign bit. */
+
+#define TWO_FIFTYTWO 0x43300000 /* 2**52 */
+#define ONE_DOT_ZERO 0x3ff00000 /* 1.0 */
+
+#define ZERO %f10 /* 0.0 */
+#define SIGN_BIT %f12 /* -0.0 */
+
+ENTRY (__ceil_vis3)
+ sethi %hi(TWO_FIFTYTWO), %o2
+ sethi %hi(ONE_DOT_ZERO), %o3
+ fzero ZERO
+
+ sllx %o2, 32, %o2
+ fnegd ZERO, SIGN_BIT
+
+ sllx %o3, 32, %o3
+ movxtod %o2, %f16
+ fabsd %f0, %f14
+
+ fcmpd %fcc3, %f14, %f16
+
+ fmovduge %fcc3, ZERO, %f16
+ fand %f0, SIGN_BIT, SIGN_BIT
+
+ for %f16, SIGN_BIT, %f16
+ faddd %f0, %f16, %f18
+ fsubd %f18, %f16, %f18
+ fcmpd %fcc2, %f18, %f0
+ movxtod %o3, %f20
+
+ fmovduge %fcc2, ZERO, %f20
+ faddd %f18, %f20, %f0
+ fabsd %f0, %f0
+ retl
+ for %f0, SIGN_BIT, %f0
+END (__ceil_vis3)
diff --git a/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil.S b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil.S
new file mode 100644
index 000000000..fa4c7c353
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil.S
@@ -0,0 +1,12 @@
+#include <sparc-ifunc.h>
+
+SPARC_ASM_VIS3_IFUNC(ceil)
+
+weak_alias (__ceil, ceil)
+
+# undef weak_alias
+# define weak_alias(a, b)
+
+#define __ceil __ceil_generic
+
+#include "../s_ceil.S"
diff --git a/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf-vis3.S b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf-vis3.S
new file mode 100644
index 000000000..09d2d3dbe
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf-vis3.S
@@ -0,0 +1,73 @@
+/* Float ceil function, sparc64 vis3 version.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by David S. Miller <davem@davemloft.net>, 2012.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <sysdep.h>
+
+ /* Since changing the rounding mode is extremely expensive, we
+ try to round up using a method that is rounding mode
+ agnostic.
+
+ We add then subtract (or subtract than add if the initial
+ value was negative) 2**23 to the value, then subtract it
+ back out.
+
+ This will clear out the fractional portion of the value.
+ One of two things will happen for non-whole initial values.
+ Either the rounding mode will round it up, or it will be
+ rounded down. If the value started out whole, it will be
+ equal after the addition and subtraction. This means we
+ can accurately detect with one test whether we need to add
+ another 1.0 to round it up properly.
+
+ VIS instructions are used to facilitate the formation of
+ easier constants, and the propagation of the sign bit. */
+
+#define TWO_TWENTYTHREE 0x4b000000 /* 2**23 */
+#define ONE_DOT_ZERO 0x3f800000 /* 1.0 */
+
+#define ZERO %f10 /* 0.0 */
+#define SIGN_BIT %f12 /* -0.0 */
+
+ENTRY (__ceilf_vis3)
+ sethi %hi(TWO_TWENTYTHREE), %o2
+ sethi %hi(ONE_DOT_ZERO), %o3
+ fzeros ZERO
+
+ fnegs ZERO, SIGN_BIT
+
+ movwtos %o2, %f16
+ fabss %f1, %f14
+
+ fcmps %fcc3, %f14, %f16
+
+ fmovsuge %fcc3, ZERO, %f16
+ fands %f1, SIGN_BIT, SIGN_BIT
+
+ fors %f16, SIGN_BIT, %f16
+ fadds %f1, %f16, %f5
+ fsubs %f5, %f16, %f5
+ fcmps %fcc2, %f5, %f1
+ movwtos %o3, %f9
+
+ fmovsuge %fcc2, ZERO, %f9
+ fadds %f5, %f9, %f0
+ fabss %f0, %f0
+ retl
+ fors %f0, SIGN_BIT, %f0
+END (__ceilf_vis3)
diff --git a/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf.S b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf.S
new file mode 100644
index 000000000..3047dd8fa
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf.S
@@ -0,0 +1,12 @@
+#include <sparc-ifunc.h>
+
+SPARC_ASM_VIS3_IFUNC(ceilf)
+
+weak_alias (__ceilf, ceilf)
+
+# undef weak_alias
+# define weak_alias(a, b)
+
+#define __ceilf __ceilf_generic
+
+#include "../s_ceilf.S"
diff --git a/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_finite-vis3.S b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_finite-vis3.S
new file mode 100644
index 000000000..6929b56ba
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_finite-vis3.S
@@ -0,0 +1,28 @@
+/* finite(). sparc64 vis3 version.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy 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 (__finite_vis3)
+ fabsd %f0, %f0
+ movstouw %f0, %o0
+ sethi %hi(0x7ff00000), %o2
+ sub %o0, %o2, %o0
+ retl
+ srl %o0, 31, %o0
+END (__finite_vis3)
diff --git a/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_finite.S b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_finite.S
new file mode 100644
index 000000000..78406a62b
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_finite.S
@@ -0,0 +1,15 @@
+#include <sparc-ifunc.h>
+
+SPARC_ASM_VIS3_IFUNC(finite)
+
+hidden_def (__finite)
+weak_alias (__finite, finite)
+
+# undef weak_alias
+# define weak_alias(a, b)
+# undef hidden_def
+# define hidden_def(a)
+
+#define __finite __finite_generic
+
+#include "../s_finite.S"
diff --git a/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_finitef-vis3.S b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_finitef-vis3.S
new file mode 100644
index 000000000..93420ff6a
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_finitef-vis3.S
@@ -0,0 +1,28 @@
+/* finitef(). sparc64 vis3 version.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy 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 (__finitef_vis3)
+ fabss %f1, %f0
+ movstouw %f0, %o0
+ sethi %hi(0x7f800000), %o2
+ sub %o0, %o2, %o0
+ retl
+ srl %o0, 31, %o0
+END (__finitef_vis3)
diff --git a/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_finitef.S b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_finitef.S
new file mode 100644
index 000000000..cafd41fd9
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_finitef.S
@@ -0,0 +1,15 @@
+#include <sparc-ifunc.h>
+
+SPARC_ASM_VIS3_IFUNC(finitef)
+
+hidden_def (__finitef)
+weak_alias (__finitef, finitef)
+
+# undef weak_alias
+# define weak_alias(a, b)
+# undef hidden_def
+# define hidden_def(a)
+
+#define __finitef __finitef_generic
+
+#include "../s_finitef.S"
diff --git a/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_floor-vis3.S b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_floor-vis3.S
new file mode 100644
index 000000000..86ed1ae92
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_floor-vis3.S
@@ -0,0 +1,75 @@
+/* floor function, sparc64 vis3 version.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by David S. Miller <davem@davemloft.net>, 2012.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <sysdep.h>
+
+ /* Since changing the rounding mode is extremely expensive, we
+ try to round up using a method that is rounding mode
+ agnostic.
+
+ We add then subtract (or subtract than add if the initial
+ value was negative) 2**23 to the value, then subtract it
+ back out.
+
+ This will clear out the fractional portion of the value.
+ One of two things will happen for non-whole initial values.
+ Either the rounding mode will round it up, or it will be
+ rounded down. If the value started out whole, it will be
+ equal after the addition and subtraction. This means we
+ can accurately detect with one test whether we need to add
+ another 1.0 to round it up properly.
+
+ VIS instructions are used to facilitate the formation of
+ easier constants, and the propagation of the sign bit. */
+
+#define TWO_FIFTYTWO 0x43300000 /* 2**52 */
+#define ONE_DOT_ZERO 0x3ff00000 /* 1.0 */
+
+#define ZERO %f10 /* 0.0 */
+#define SIGN_BIT %f12 /* -0.0 */
+
+ENTRY (__floor_vis3)
+ sethi %hi(TWO_FIFTYTWO), %o2
+ sethi %hi(ONE_DOT_ZERO), %o3
+ fzero ZERO
+
+ sllx %o2, 32, %o2
+ fnegd ZERO, SIGN_BIT
+
+ sllx %o3, 32, %o3
+ movxtod %o2, %f16
+ fabsd %f0, %f14
+
+ fcmpd %fcc3, %f14, %f16
+
+ fmovduge %fcc3, ZERO, %f16
+ fand %f0, SIGN_BIT, SIGN_BIT
+
+ for %f16, SIGN_BIT, %f16
+ faddd %f0, %f16, %f18
+ fsubd %f18, %f16, %f18
+ fcmpd %fcc2, %f18, %f0
+ movxtod %o3, %f20
+
+ fmovdule %fcc2, ZERO, %f20
+ fsubd %f18, %f20, %f0
+ fabsd %f0, %f0
+ retl
+ for %f0, SIGN_BIT, %f0
+END (__floor_vis3)
diff --git a/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_floor.S b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_floor.S
new file mode 100644
index 000000000..6ae9947a7
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_floor.S
@@ -0,0 +1,12 @@
+#include <sparc-ifunc.h>
+
+SPARC_ASM_VIS3_IFUNC(floor)
+
+weak_alias (__floor, floor)
+
+# undef weak_alias
+# define weak_alias(a, b)
+
+#define __floor __floor_generic
+
+#include "../s_floor.S"
diff --git a/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf-vis3.S b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf-vis3.S
new file mode 100644
index 000000000..b663b6475
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf-vis3.S
@@ -0,0 +1,73 @@
+/* Float floor function, sparc64 vis3 version.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by David S. Miller <davem@davemloft.net>, 2012.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <sysdep.h>
+
+ /* Since changing the rounding mode is extremely expensive, we
+ try to round up using a method that is rounding mode
+ agnostic.
+
+ We add then subtract (or subtract than add if the initial
+ value was negative) 2**23 to the value, then subtract it
+ back out.
+
+ This will clear out the fractional portion of the value.
+ One of two things will happen for non-whole initial values.
+ Either the rounding mode will round it up, or it will be
+ rounded down. If the value started out whole, it will be
+ equal after the addition and subtraction. This means we
+ can accurately detect with one test whether we need to add
+ another 1.0 to round it up properly.
+
+ VIS instructions are used to facilitate the formation of
+ easier constants, and the propagation of the sign bit. */
+
+#define TWO_TWENTYTHREE 0x4b000000 /* 2**23 */
+#define ONE_DOT_ZERO 0x3f800000 /* 1.0 */
+
+#define ZERO %f10 /* 0.0 */
+#define SIGN_BIT %f12 /* -0.0 */
+
+ENTRY (__floorf_vis3)
+ sethi %hi(TWO_TWENTYTHREE), %o2
+ sethi %hi(ONE_DOT_ZERO), %o3
+ fzeros ZERO
+
+ fnegs ZERO, SIGN_BIT
+
+ movwtos %o2, %f16
+ fabss %f1, %f14
+
+ fcmps %fcc3, %f14, %f16
+
+ fmovsuge %fcc3, ZERO, %f16
+ fands %f1, SIGN_BIT, SIGN_BIT
+
+ fors %f16, SIGN_BIT, %f16
+ fadds %f1, %f16, %f5
+ fsubs %f5, %f16, %f5
+ fcmps %fcc2, %f5, %f1
+ movwtos %o3, %f9
+
+ fmovsule %fcc2, ZERO, %f9
+ fsubs %f5, %f9, %f0
+ fabss %f0, %f0
+ retl
+ fors %f0, SIGN_BIT, %f0
+END (__floorf_vis3)
diff --git a/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf.S b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf.S
new file mode 100644
index 000000000..31cda385b
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf.S
@@ -0,0 +1,12 @@
+#include <sparc-ifunc.h>
+
+SPARC_ASM_VIS3_IFUNC(floorf)
+
+weak_alias (__floorf, floorf)
+
+# undef weak_alias
+# define weak_alias(a, b)
+
+#define __floorf __floorf_generic
+
+#include "../s_floorf.S"
diff --git a/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_fma-vis3.S b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_fma-vis3.S
new file mode 100644
index 000000000..8b57eb234
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_fma-vis3.S
@@ -0,0 +1,25 @@
+/* fma function, sparc64 vis3 version.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by David S. Miller <davem@davemloft.net>, 2012.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <sysdep.h>
+
+ENTRY (__fma_vis3)
+ retl
+ fmaddd %f0, %f2, %f4, %f0
+END (__fma_vis3)
diff --git a/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_fma.c b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_fma.c
new file mode 100644
index 000000000..3f2f1622c
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_fma.c
@@ -0,0 +1,14 @@
+#ifdef HAVE_AS_VIS3_SUPPORT
+# include <sparc-ifunc.h>
+# include <math.h>
+
+extern double __fma_vis3 (double, double, double);
+extern double __fma_generic (double, double, double);
+
+sparc_libm_ifunc(__fma, hwcap & HWCAP_SPARC_FMAF ? __fma_vis3 : __fma_generic);
+weak_alias (__fma, fma)
+
+# define __fma __fma_generic
+#endif
+
+#include <sysdeps/ieee754/dbl-64/s_fma.c>
diff --git a/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaf-vis3.S b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaf-vis3.S
new file mode 100644
index 000000000..e431e7170
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaf-vis3.S
@@ -0,0 +1,25 @@
+/* fmaf function, sparc64 vis3 version.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by David S. Miller <davem@davemloft.net>, 2012.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <sysdep.h>
+
+ENTRY (__fmaf_vis3)
+ retl
+ fmadds %f1, %f3, %f5, %f0
+END (__fmaf_vis3)
diff --git a/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaf.c b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaf.c
new file mode 100644
index 000000000..7a273a3b1
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaf.c
@@ -0,0 +1,14 @@
+#ifdef HAVE_AS_VIS3_SUPPORT
+# include <sparc-ifunc.h>
+# include <math.h>
+
+extern float __fmaf_vis3 (float, float, float);
+extern float __fmaf_generic (float, float, float);
+
+sparc_libm_ifunc(__fmaf, hwcap & HWCAP_SPARC_FMAF ? __fmaf_vis3 : __fmaf_generic);
+weak_alias (__fmaf, fmaf)
+
+# define __fmaf __fmaf_generic
+#endif
+
+#include <sysdeps/ieee754/dbl-64/s_fmaf.c>
diff --git a/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_fmax-vis3.S b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_fmax-vis3.S
new file mode 100644
index 000000000..777bb6eee
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_fmax-vis3.S
@@ -0,0 +1,26 @@
+/* fmax function, sparc64 vis3 version.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by David S. Miller <davem@davemloft.net>, 2012.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <sysdep.h>
+
+ENTRY (__fmax_vis3)
+ flcmpd %fcc1, %f0, %f2
+ retl
+ fmovdlg %fcc1, %f2, %f0
+END (__fmax_vis3)
diff --git a/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_fmax.S b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_fmax.S
new file mode 100644
index 000000000..d5e59d8d1
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_fmax.S
@@ -0,0 +1,12 @@
+#include <sparc-ifunc.h>
+
+SPARC_ASM_VIS3_IFUNC(fmax)
+
+weak_alias (__fmax, fmax)
+
+# undef weak_alias
+# define weak_alias(a, b)
+
+#define __fmax __fmax_generic
+
+#include "../s_fmax.S"
diff --git a/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaxf-vis3.S b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaxf-vis3.S
new file mode 100644
index 000000000..b3f2e85cd
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaxf-vis3.S
@@ -0,0 +1,27 @@
+/* fmaxf function, sparc64 vis3 version.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by David S. Miller <davem@davemloft.net>, 2012.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <sysdep.h>
+
+ENTRY (__fmaxf_vis3)
+ flcmps %fcc1, %f1, %f3
+ fmovs %f1, %f0
+ retl
+ fmovslg %fcc1, %f3, %f0
+END (__fmaxf_vis3)
diff --git a/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaxf.S b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaxf.S
new file mode 100644
index 000000000..daa91579c
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaxf.S
@@ -0,0 +1,12 @@
+#include <sparc-ifunc.h>
+
+SPARC_ASM_VIS3_IFUNC(fmaxf)
+
+weak_alias (__fmaxf, fmaxf)
+
+# undef weak_alias
+# define weak_alias(a, b)
+
+#define __fmaxf __fmaxf_generic
+
+#include "../s_fmaxf.S"
diff --git a/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_fmin-vis3.S b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_fmin-vis3.S
new file mode 100644
index 000000000..edb5823b4
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_fmin-vis3.S
@@ -0,0 +1,26 @@
+/* fmin function, sparc64 vis3 version.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by David S. Miller <davem@davemloft.net>, 2012.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <sysdep.h>
+
+ENTRY (__fmin_vis3)
+ flcmpd %fcc1, %f0, %f2
+ retl
+ fmovdge %fcc1, %f2, %f0
+END (__fmin_vis3)
diff --git a/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_fmin.S b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_fmin.S
new file mode 100644
index 000000000..b2aec1bbc
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_fmin.S
@@ -0,0 +1,12 @@
+#include <sparc-ifunc.h>
+
+SPARC_ASM_VIS3_IFUNC(fmin)
+
+weak_alias (__fmin, fmin)
+
+# undef weak_alias
+# define weak_alias(a, b)
+
+#define __fmin __fmin_generic
+
+#include "../s_fmin.S"
diff --git a/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_fminf-vis3.S b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_fminf-vis3.S
new file mode 100644
index 000000000..81d5fb178
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_fminf-vis3.S
@@ -0,0 +1,27 @@
+/* fminf function, sparc64 vis3 version.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by David S. Miller <davem@davemloft.net>, 2012.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <sysdep.h>
+
+ENTRY (__fminf_vis3)
+ flcmps %fcc1, %f1, %f3
+ fmovs %f1, %f0
+ retl
+ fmovsge %fcc1, %f3, %f0
+END (__fminf_vis3)
diff --git a/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_fminf.S b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_fminf.S
new file mode 100644
index 000000000..c4690e1df
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_fminf.S
@@ -0,0 +1,12 @@
+#include <sparc-ifunc.h>
+
+SPARC_ASM_VIS3_IFUNC(fminf)
+
+weak_alias (__fminf, fminf)
+
+# undef weak_alias
+# define weak_alias(a, b)
+
+#define __fminf __fminf_generic
+
+#include "../s_fminf.S"
diff --git a/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_isinf-vis3.S b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_isinf-vis3.S
new file mode 100644
index 000000000..7f7cd5ee6
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_isinf-vis3.S
@@ -0,0 +1,31 @@
+/* isinf(). sparc64 vis3 version.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy 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 (__isinf_vis3)
+ movdtox %f0, %g1
+ sethi %hi(0x7ff00000), %o2
+ sllx %o2, 32, %o2
+ sllx %g1, 1, %o4
+ srlx %o4, 1, %o5
+ srax %g1, 62, %o0
+ xor %o5, %o2, %o3
+ retl
+ movrne %o3, %g0, %o0
+END (__isinf_vis3)
diff --git a/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_isinf.S b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_isinf.S
new file mode 100644
index 000000000..ed9b62640
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_isinf.S
@@ -0,0 +1,15 @@
+#include <sparc-ifunc.h>
+
+SPARC_ASM_VIS3_IFUNC(isinf)
+
+hidden_def (__isinf)
+weak_alias (__isinf, isinf)
+
+# undef weak_alias
+# define weak_alias(a, b)
+# undef hidden_def
+# define hidden_def(a)
+
+#define __isinf __isinf_generic
+
+#include "../s_isinf.S"
diff --git a/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_isinff-vis3.S b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_isinff-vis3.S
new file mode 100644
index 000000000..7d59d5db3
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_isinff-vis3.S
@@ -0,0 +1,30 @@
+/* isinff(). sparc64 vis3 version.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy 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 (__isinff_vis3)
+ movstouw %f1, %g1
+ sethi %hi(0x7f800000), %o2
+ sll %g1, 1, %o4
+ srl %o4, 1, %o5
+ sra %g1, 30, %o0
+ xor %o5, %o2, %o3
+ retl
+ movrne %o3, %g0, %o0
+END (__isinff_vis3)
diff --git a/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_isinff.S b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_isinff.S
new file mode 100644
index 000000000..04517398f
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_isinff.S
@@ -0,0 +1,15 @@
+#include <sparc-ifunc.h>
+
+SPARC_ASM_VIS3_IFUNC(isinff)
+
+hidden_def (__isinff)
+weak_alias (__isinff, isinff)
+
+# undef weak_alias
+# define weak_alias(a, b)
+# undef hidden_def
+# define hidden_def(a)
+
+#define __isinff __isinff_generic
+
+#include "../s_isinff.S"
diff --git a/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_isnan-vis3.S b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_isnan-vis3.S
new file mode 100644
index 000000000..b3b101444
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_isnan-vis3.S
@@ -0,0 +1,30 @@
+/* isnan(). sparc64 vis3 version.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy 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 (__isnan_vis3)
+ movdtox %f0, %o0
+ sethi %hi(0x7ff00000), %g1
+ sllx %g1, 32, %g1
+ sllx %o0, 1, %o0
+ srlx %o0, 1, %o0
+ sub %g1, %o0, %o0
+ retl
+ srlx %o0, 63, %o0
+END (__isnan_vis3)
diff --git a/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_isnan.S b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_isnan.S
new file mode 100644
index 000000000..40e985a5d
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_isnan.S
@@ -0,0 +1,15 @@
+#include <sparc-ifunc.h>
+
+SPARC_ASM_VIS3_IFUNC(isnan)
+
+hidden_def (__isnan)
+weak_alias (__isnan, isnan)
+
+# undef weak_alias
+# define weak_alias(a, b)
+# undef hidden_def
+# define hidden_def(a)
+
+#define __isnan __isnan_generic
+
+#include "../s_isnan.S"
diff --git a/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_isnanf-vis3.S b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_isnanf-vis3.S
new file mode 100644
index 000000000..cd60d3e56
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_isnanf-vis3.S
@@ -0,0 +1,29 @@
+/* isnanf(). sparc64 vis3 version.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy 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 (__isnanf_vis3)
+ movstouw %f1, %o0
+ sethi %hi(0x7f800000), %g1
+ sll %o0, 1, %o0
+ srl %o0, 1, %o0
+ sub %g1, %o0, %o0
+ retl
+ srl %o0, 31, %o0
+END (__isnanf_vis3)
diff --git a/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_isnanf.S b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_isnanf.S
new file mode 100644
index 000000000..6b53b69d2
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_isnanf.S
@@ -0,0 +1,15 @@
+#include <sparc-ifunc.h>
+
+SPARC_ASM_VIS3_IFUNC(isnanf)
+
+hidden_def (__isnanf)
+weak_alias (__isnanf, isnanf)
+
+# undef weak_alias
+# define weak_alias(a, b)
+# undef hidden_def
+# define hidden_def(a)
+
+#define __isnanf __isnanf_generic
+
+#include "../s_isnanf.S"
diff --git a/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_lrint-vis3.S b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_lrint-vis3.S
new file mode 100644
index 000000000..4633017fc
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_lrint-vis3.S
@@ -0,0 +1,52 @@
+/* lrint(), sparc64 vis3 version.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by David S. Miller <davem@davemloft.net>, 2012.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <sysdep.h>
+
+ /* VIS instructions are used to facilitate the formation of
+ easier constants, and the propagation of the sign bit. */
+
+#define TWO_FIFTYTWO 0x43300000 /* 2**52 */
+
+#define ZERO %f10 /* 0.0 */
+#define SIGN_BIT %f12 /* -0.0 */
+
+ENTRY (__lrint_vis3)
+ sethi %hi(TWO_FIFTYTWO), %o2
+ sllx %o2, 32, %o2
+ fzero ZERO
+
+ fnegd ZERO, SIGN_BIT
+ movxtod %o2, %f16
+ fabsd %f0, %f14
+
+ fcmpd %fcc3, %f14, %f16
+
+ fmovduge %fcc3, ZERO, %f16
+ fand %f0, SIGN_BIT, SIGN_BIT
+
+ for %f16, SIGN_BIT, %f16
+ faddd %f0, %f16, %f6
+ fsubd %f6, %f16, %f0
+ fabsd %f0, %f0
+ for %f0, SIGN_BIT, %f0
+ fdtox %f0, %f4
+ retl
+ movdtox %f4, %o0
+END (__lrint_vis3)
diff --git a/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_lrint.S b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_lrint.S
new file mode 100644
index 000000000..94af8f028
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_lrint.S
@@ -0,0 +1,17 @@
+#include <sparc-ifunc.h>
+
+SPARC_ASM_VIS3_IFUNC(lrint)
+
+weak_alias (__lrint, lrint)
+
+strong_alias (__lrint, __llrint)
+weak_alias (__llrint, llrint)
+
+# undef weak_alias
+# define weak_alias(a, b)
+# undef strong_alias
+# define strong_alias(a, b)
+
+#define __lrint __lrint_generic
+
+#include "../s_lrint.S"
diff --git a/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf-vis3.S b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf-vis3.S
new file mode 100644
index 000000000..6358732f1
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf-vis3.S
@@ -0,0 +1,51 @@
+/* lrintf(), sparc64 vis3 version.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by David S. Miller <davem@davemloft.net>, 2012.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <sysdep.h>
+
+ /* VIS instructions are used to facilitate the formation of
+ easier constants, and the propagation of the sign bit. */
+
+#define TWO_TWENTYTHREE 0x4b000000 /* 2**23 */
+
+#define ZERO %f10 /* 0.0 */
+#define SIGN_BIT %f12 /* -0.0 */
+
+ENTRY (__lrintf_vis3)
+ sethi %hi(TWO_TWENTYTHREE), %o2
+ fzeros ZERO
+
+ fnegs ZERO, SIGN_BIT
+ movwtos %o2, %f16
+ fabss %f1, %f14
+
+ fcmps %fcc3, %f14, %f16
+
+ fmovsuge %fcc3, ZERO, %f16
+ fands %f1, SIGN_BIT, SIGN_BIT
+
+ fors %f16, SIGN_BIT, %f16
+ fadds %f1, %f16, %f5
+ fsubs %f5, %f16, %f0
+ fabss %f0, %f0
+ fors %f0, SIGN_BIT, %f0
+ fstox %f0, %f4
+ retl
+ movdtox %f4, %o0
+END (__lrintf_vis3)
diff --git a/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf.S b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf.S
new file mode 100644
index 000000000..e6ea4061c
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf.S
@@ -0,0 +1,17 @@
+#include <sparc-ifunc.h>
+
+SPARC_ASM_VIS3_IFUNC(lrintf)
+
+weak_alias (__lrintf, lrintf)
+
+strong_alias (__lrintf, __llrintf)
+weak_alias (__llrintf, llrintf)
+
+# undef weak_alias
+# define weak_alias(a, b)
+# undef strong_alias
+# define strong_alias(a, b)
+
+#define __lrintf __lrintf_generic
+
+#include "../s_lrintf.S"
diff --git a/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_rint-vis3.S b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_rint-vis3.S
new file mode 100644
index 000000000..d4fcd19d9
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_rint-vis3.S
@@ -0,0 +1,50 @@
+/* Round float to int floating-point values, sparc64 vis3 version.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by David S. Miller <davem@davemloft.net>, 2012.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <sysdep.h>
+
+ /* VIS instructions are used to facilitate the formation of
+ easier constants, and the propagation of the sign bit. */
+
+#define TWO_FIFTYTWO 0x43300000 /* 2**52 */
+
+#define ZERO %f10 /* 0.0 */
+#define SIGN_BIT %f12 /* -0.0 */
+
+ENTRY (__rint_vis3)
+ sethi %hi(TWO_FIFTYTWO), %o2
+ sllx %o2, 32, %o2
+ fzero ZERO
+
+ fnegd ZERO, SIGN_BIT
+ movxtod %o2, %f16
+ fabsd %f0, %f14
+
+ fcmpd %fcc3, %f14, %f16
+
+ fmovduge %fcc3, ZERO, %f16
+ fand %f0, SIGN_BIT, SIGN_BIT
+
+ for %f16, SIGN_BIT, %f16
+ faddd %f0, %f16, %f6
+ fsubd %f6, %f16, %f0
+ fabsd %f0, %f0
+ retl
+ for %f0, SIGN_BIT, %f0
+END (__rint_vis3)
diff --git a/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_rint.S b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_rint.S
new file mode 100644
index 000000000..cc980eb8c
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_rint.S
@@ -0,0 +1,12 @@
+#include <sparc-ifunc.h>
+
+SPARC_ASM_VIS3_IFUNC(rint)
+
+weak_alias (__rint, rint)
+
+# undef weak_alias
+# define weak_alias(a, b)
+
+#define __rint __rint_generic
+
+#include "../s_rint.S"
diff --git a/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_rintf-vis3.S b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_rintf-vis3.S
new file mode 100644
index 000000000..ea640589e
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_rintf-vis3.S
@@ -0,0 +1,49 @@
+/* Round float to int floating-point values, sparc64 vis3 version.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by David S. Miller <davem@davemloft.net>, 2012.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <sysdep.h>
+
+ /* VIS instructions are used to facilitate the formation of
+ easier constants, and the propagation of the sign bit. */
+
+#define TWO_TWENTYTHREE 0x4b000000 /* 2**23 */
+
+#define ZERO %f10 /* 0.0 */
+#define SIGN_BIT %f12 /* -0.0 */
+
+ENTRY (__rintf_vis3)
+ sethi %hi(TWO_TWENTYTHREE), %o2
+ fzeros ZERO
+
+ fnegs ZERO, SIGN_BIT
+ movwtos %o2, %f16
+ fabss %f1, %f14
+
+ fcmps %fcc3, %f14, %f16
+
+ fmovsuge %fcc3, ZERO, %f16
+ fands %f1, SIGN_BIT, SIGN_BIT
+
+ fors %f16, SIGN_BIT, %f16
+ fadds %f1, %f16, %f5
+ fsubs %f5, %f16, %f0
+ fabss %f0, %f0
+ retl
+ fors %f0, SIGN_BIT, %f0
+END (__rintf_vis3)
diff --git a/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_rintf.S b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_rintf.S
new file mode 100644
index 000000000..38fd93608
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_rintf.S
@@ -0,0 +1,12 @@
+#include <sparc-ifunc.h>
+
+SPARC_ASM_VIS3_IFUNC(rintf)
+
+weak_alias (__rintf, rintf)
+
+# undef weak_alias
+# define weak_alias(a, b)
+
+#define __rintf __rintf_generic
+
+#include "../s_rintf.S"
diff --git a/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_signbit-vis3.S b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_signbit-vis3.S
new file mode 100644
index 000000000..8d54e32ac
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_signbit-vis3.S
@@ -0,0 +1,25 @@
+/* signbit(). sparc64 vis3 version.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy 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 (__signbit_vis3)
+ movdtox %f0, %o0
+ retl
+ srlx %o0, 63, %o0
+END (__signbit_vis3)
diff --git a/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_signbit.S b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_signbit.S
new file mode 100644
index 000000000..e69550c47
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_signbit.S
@@ -0,0 +1,23 @@
+#include <sparc-ifunc.h>
+
+SPARC_ASM_VIS3_IFUNC(signbit)
+
+weak_alias (__signbit, signbit)
+
+/* On 64-bit the double version will also always work for
+ long-double-precision since in both cases the word with the
+ sign bit in it is passed always in register %f0. */
+strong_alias (__signbit, __signbitl)
+hidden_def (__signbitl)
+weak_alias (__signbitl, signbitl)
+
+# undef weak_alias
+# define weak_alias(a, b)
+# undef strong_alias
+# define strong_alias(a, b)
+# undef hidden_def
+# define hidden_def(a)
+
+#define __signbit __signbit_generic
+
+#include "../s_signbit.S"
diff --git a/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_signbitf-vis3.S b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_signbitf-vis3.S
new file mode 100644
index 000000000..004b0870d
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_signbitf-vis3.S
@@ -0,0 +1,25 @@
+/* signbitf(). sparc64 vis3 version.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy 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 (__signbitf_vis3)
+ movstouw %f1, %o0
+ retl
+ srl %o0, 31, %o0
+END (__signbitf_vis3)
diff --git a/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_signbitf.S b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_signbitf.S
new file mode 100644
index 000000000..c35c79f88
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc64/fpu/multiarch/s_signbitf.S
@@ -0,0 +1,12 @@
+#include <sparc-ifunc.h>
+
+SPARC_ASM_VIS3_IFUNC(signbitf)
+
+weak_alias (__signbitf, signbitf)
+
+# undef weak_alias
+# define weak_alias(a, b)
+
+#define __signbitf __signbitf_generic
+
+#include "../s_signbitf.S"
diff --git a/libc/sysdeps/sparc/sparc64/fpu/s_copysign.S b/libc/sysdeps/sparc/sparc64/fpu/s_copysign.S
index 571f57cbd..f7f69fb8d 100644
--- a/libc/sysdeps/sparc/sparc64/fpu/s_copysign.S
+++ b/libc/sysdeps/sparc/sparc64/fpu/s_copysign.S
@@ -20,9 +20,8 @@
#include <sysdep.h>
ENTRY (__copysign)
- sethi %hi(0x80000000), %g1
- st %g1, [%sp + STACK_BIAS + 128]
- ld [%sp + STACK_BIAS + 128], %f7
+ fzeros %f7
+ fnegs %f7, %f7
fands %f2, %f7, %f9
fandnot2s %f0, %f7, %f0
retl
diff --git a/libc/sysdeps/sparc/sparc64/fpu/s_copysignf.S b/libc/sysdeps/sparc/sparc64/fpu/s_copysignf.S
index db6a384c6..85577a717 100644
--- a/libc/sysdeps/sparc/sparc64/fpu/s_copysignf.S
+++ b/libc/sysdeps/sparc/sparc64/fpu/s_copysignf.S
@@ -20,9 +20,8 @@
#include <sysdep.h>
ENTRY (__copysignf)
- sethi %hi(0x80000000), %g1
- st %g1, [%sp + STACK_BIAS + 128]
- ld [%sp + STACK_BIAS + 128], %f7
+ fzeros %f7
+ fnegs %f7, %f7
fands %f3, %f7, %f9
fandnot2s %f1, %f7, %f1
retl
diff --git a/libc/sysdeps/sparc/sparc64/fpu/s_fma.c b/libc/sysdeps/sparc/sparc64/fpu/s_fma.c
new file mode 100644
index 000000000..8f6260587
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc64/fpu/s_fma.c
@@ -0,0 +1,2 @@
+/* Always use dbl-64 version because long double is emulated in software. */
+#include <sysdeps/ieee754/dbl-64/s_fma.c>
diff --git a/libc/sysdeps/sparc/sparc64/fpu/s_fmax.S b/libc/sysdeps/sparc/sparc64/fpu/s_fmax.S
new file mode 100644
index 000000000..21a2c8095
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc64/fpu/s_fmax.S
@@ -0,0 +1,36 @@
+/* fmax function, sparc64 version.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by David S. Miller <davem@davemloft.net>, 2012.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <sysdep.h>
+
+#define SIGN_BIT %f12 /* -0.0 */
+
+ENTRY (__fmax)
+ fcmpd %fcc1, %f2, %f2
+ fzero SIGN_BIT
+ fmovdu %fcc1, %f0, %f2
+ fnegd SIGN_BIT, SIGN_BIT
+ fcmpd %fcc2, %f0, %f2
+ fmovdul %fcc2, %f2, %f0
+ fand %f0, %f2, %f4
+ fandnot2 SIGN_BIT, %f4, %f4
+ retl
+ fandnot2 %f0, %f4, %f0
+END (__fmax)
+weak_alias (__fmax, fmax)
diff --git a/libc/sysdeps/sparc/sparc64/fpu/s_fmaxf.S b/libc/sysdeps/sparc/sparc64/fpu/s_fmaxf.S
new file mode 100644
index 000000000..989c5c300
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc64/fpu/s_fmaxf.S
@@ -0,0 +1,36 @@
+/* fmaxf function, sparc64 version.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by David S. Miller <davem@davemloft.net>, 2012.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <sysdep.h>
+
+#define SIGN_BIT %f12 /* -0.0 */
+
+ENTRY (__fmaxf)
+ fcmps %fcc1, %f3, %f3
+ fzeros SIGN_BIT
+ fmovsu %fcc1, %f1, %f3
+ fnegs SIGN_BIT, SIGN_BIT
+ fcmps %fcc2, %f1, %f3
+ fmovsul %fcc2, %f3, %f1
+ fands %f1, %f3, %f4
+ fandnot2s SIGN_BIT, %f4, %f4
+ retl
+ fandnot2s %f1, %f4, %f0
+END (__fmaxf)
+weak_alias (__fmaxf, fmaxf)
diff --git a/libc/sysdeps/sparc/sparc64/fpu/s_fmin.S b/libc/sysdeps/sparc/sparc64/fpu/s_fmin.S
new file mode 100644
index 000000000..01105e697
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc64/fpu/s_fmin.S
@@ -0,0 +1,36 @@
+/* fmin function, sparc64 version.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by David S. Miller <davem@davemloft.net>, 2012.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <sysdep.h>
+
+#define SIGN_BIT %f12 /* -0.0 */
+
+ENTRY (__fmin)
+ fcmpd %fcc1, %f2, %f2
+ fzero SIGN_BIT
+ fmovdu %fcc1, %f0, %f2
+ fnegd SIGN_BIT, SIGN_BIT
+ fcmpd %fcc2, %f0, %f2
+ fmovdug %fcc2, %f2, %f0
+ for %f0, %f2, %f4
+ fand %f4, SIGN_BIT, %f4
+ retl
+ for %f0, %f4, %f0
+END (__fmin)
+weak_alias (__fmin, fmin)
diff --git a/libc/sysdeps/sparc/sparc64/fpu/s_fminf.S b/libc/sysdeps/sparc/sparc64/fpu/s_fminf.S
new file mode 100644
index 000000000..13a0ef40e
--- /dev/null
+++ b/libc/sysdeps/sparc/sparc64/fpu/s_fminf.S
@@ -0,0 +1,36 @@
+/* fminf function, sparc64 version.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by David S. Miller <davem@davemloft.net>, 2012.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <sysdep.h>
+
+#define SIGN_BIT %f12 /* -0.0 */
+
+ENTRY (__fminf)
+ fcmps %fcc1, %f3, %f3
+ fzeros SIGN_BIT
+ fmovsu %fcc1, %f1, %f3
+ fnegs SIGN_BIT, SIGN_BIT
+ fcmps %fcc2, %f1, %f3
+ fmovsug %fcc2, %f3, %f1
+ fors %f1, %f3, %f4
+ fands %f4, SIGN_BIT, %f4
+ retl
+ fors %f1, %f4, %f0
+END (__fminf)
+weak_alias (__fminf, fminf)
diff --git a/libc/sysdeps/sparc/sparc64/hp-timing.h b/libc/sysdeps/sparc/sparc64/hp-timing.h
index b68f653fb..684b846f5 100644
--- a/libc/sysdeps/sparc/sparc64/hp-timing.h
+++ b/libc/sysdeps/sparc/sparc64/hp-timing.h
@@ -22,7 +22,7 @@
#include <string.h>
#include <sys/param.h>
-#include <stdio-common/_itoa.h>
+#include <_itoa.h>
#define HP_TIMING_AVAIL (1)
#define HP_TIMING_INLINE (1)
diff --git a/libc/sysdeps/sparc/sparc64/multiarch/memcpy.S b/libc/sysdeps/sparc/sparc64/multiarch/memcpy.S
index 739687f3b..36c488672 100644
--- a/libc/sysdeps/sparc/sparc64/multiarch/memcpy.S
+++ b/libc/sysdeps/sparc/sparc64/multiarch/memcpy.S
@@ -18,7 +18,6 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
-#include <rtld-global-offsets.h>
#if !defined NOT_IN_libc
.text
diff --git a/libc/sysdeps/sparc/sparc64/multiarch/memset.S b/libc/sysdeps/sparc/sparc64/multiarch/memset.S
index 13533450c..c717f0c9a 100644
--- a/libc/sysdeps/sparc/sparc64/multiarch/memset.S
+++ b/libc/sysdeps/sparc/sparc64/multiarch/memset.S
@@ -18,7 +18,6 @@
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
-#include <rtld-global-offsets.h>
#if !defined NOT_IN_libc
.text
diff --git a/libc/sysdeps/unix/Makefile b/libc/sysdeps/unix/Makefile
index 4b887a7a8..c8ef96d50 100644
--- a/libc/sysdeps/unix/Makefile
+++ b/libc/sysdeps/unix/Makefile
@@ -1,5 +1,4 @@
-# Copyright (C) 1991,1992,1993,1994,1995,1996,1997,1998,1999,2003,2006,2008,2009
-# Free Software Foundation, Inc.
+# Copyright (C) 1991-2012 Free Software 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,243 +15,6 @@
# License along with the GNU C Library; if not, see
# <http://www.gnu.org/licenses/>.
-# The unix-specific configure fragment writes `unix-generated' in config.make.
-config-generated := $(config-generated) $(unix-generated)
-
-ifeq (,$(filter-out $(sysdep_dir)/generic/ $(common-objpfx),\
- $(dir $(firstword $(wildcard $(+sysdep_dirs:%=%/bits/local_lim.h))))))
-
-ifneq (,$(wildcard $(sysincludedir)/sys/param.h))
-mk-local_lim-CFLAGS += -DHAVE_SYS_PARAM_H
-endif
-ifneq (,$(wildcard $(sysincludedir)/sys/limits.h))
-mk-local_lim-CFLAGS += -DHAVE_SYS_LIMITS_H
-endif
-ifneq (,$(wildcard $(sysincludedir)/limits.h))
-mk-local_lim-CFLAGS += -DHAVE_LIMITS_H
-endif
-
-$(common-objpfx)bits/local_lim.h: $(common-objpfx)mk-local_lim
- $(dir $<)$(notdir $<) > $@-t
- mv -f $@-t $@
-$(common-objpfx)mk-local_lim: $(sysdep_dir)/unix/mk-local_lim.c
- $(common-objdir-compile)
-
-before-compile += $(common-objpfx)bits/local_lim.h
-common-generated += bits/local_lim.h mk-local_lim
-
-endif
-
-ifeq (,$(filter-out $(sysdep_dir)/generic/ $(common-objpfx),\
- $(patsubst %/sys/param.h,%/,\
- $(firstword $(wildcard $(+sysdep_dirs:%=%/sys/param.h))))))
-
-before-compile := $(before-compile) $(common-objpfx)sys/param.h
-
-$(common-objpfx)sys/param.h: $(sysincludedir)/sys/param.h
- $(make-target-directory)
- (echo '#ifndef _SYS_PARAM_H'; \
- echo '#define _SYS_PARAM_H 1'; \
- echo '#include <endian.h>'; \
- $(AWK) < $< \
- '/^#define[ ]*NULL/ { print "#ifndef NULL"; \
- print $$0; \
- print "#endif"; \
- was_null = 1 } \
- { if (!was_null) print $$0; \
- was_null = 0 }'; \
- echo '#ifndef MAXHOSTNAMELEN'; \
- echo '#define MAXHOSTNAMELEN 64 /* XXX */'; \
- echo '#endif /* No MAXHOSTNAMELEN. */'; \
- echo '#endif /* sys/param.h */') > $@-tmp
- mv $@-tmp $@
-
-$(common-objpfx)param.h.c: $(sysincludedir)/sys/param.h
- rm -f $@
- cp $< $@
-$(common-objpfx)param.h.dep: $(common-objpfx)param.h.c \
- $(sysdep_dir)/unix/Makefile
- $(+mkdep) -I$(sysincludedir) $< \
- | sed > $@-t \
- -e 's@$(sysincludedir)/sys/param.h@@' \
- -e 's@^.*:@@' \
- -e 's@$<@@g' \
- -e 's@$(sysincludedir)/*@@g' \
- -e 's@\\$$@@' \
- -e 's@^@sys/param.h-includes := $$(sys/param.h-includes) @'
- mv $@-t $@
-
-# Get the generated definition of sys/param.h-includes.
-ifndef no_deps
--include $(common-objpfx)param.h.dep
-endif
-
-# Don't preempt our own headers.
-sys/param.h-includes := \
- $(filter-out $(patsubst $(..)%,%,\
- $(wildcard $(addprefix $(..),\
- $(sys/param.h-includes)))),\
- $(sys/param.h-includes))
-
-
-.PHONY: sys/param.h-includes
-sys/param.h-includes: $(addprefix $(common-objpfx),$(sys/param.h-includes))
-
-ifdef sys/param.h-includes
-# Copy the system files to $(common-objdir).
-$(addprefix $(common-objpfx),$(sys/param.h-includes)): $(common-objpfx)%: \
- $(sysincludedir)/%
- $(make-target-directory)
-# Some of these files sometimes contain conflicting declarations for htons,
-# ntohs, etc. They also often contain definitions of *_ENDIAN and
-# BYTE_ORDER, which we define ourselves in <endian.h>.
- sed -e '/[ ]*[hn]to[nh][sl][ (]*/d' \
- -e '/^#define[ ]*[A-Z]*_ENDIAN/d' \
- -e '/^#define[ ]*BYTE_ORDER/d' \
- $< > $@-t
- mv $@-t $@
-endif
-
-common-generated := $(common-generated) \
- sys/param.h $(sys/param.h-includes) param.h.c param.h.dep
-
-
-ifeq ($(subdir),misc)
-
-# Install system headers the system sys/param.h uses.
-
-sysdep_headers := $(sysdep_headers) $(sys/param.h-includes)
-
-endif # misc
-
-endif # No sysdep sys/param.h.
-
-ifeq (,$(filter-out $(sysdep_dir)/generic/ $(common-objpfx),\
- $(dir $(firstword $(wildcard $(+sysdep_dirs:%=%/bits/errno.h))))))
-
-# These need to exist before any compiling is done,
-# so cpp doesn't instead find the generic versions.
-before-compile := $(before-compile) $(common-objpfx)bits/errno.h
-
-$(common-objpfx)bits/errno.h: $(common-objpfx)make-errnos
- $(dir $<)$(notdir $<) > $@-tmp
- mv $@-tmp $@
-
-$(common-objpfx)make-errnos: $(common-objpfx)make-errnos.c
- $(common-objdir-compile)
-
-$(common-objpfx)make-errnos.c: $(sysdep_dir)/unix/errnos-tmpl.c \
- $(sysdep_dir)/unix/errnos.awk $(common-objpfx)errnos
- $(AWK) -f $(word 2,$^) errnos="`tr '\012' ' ' < $(word 3,$^)`" $< > $@T
- mv $@T $@
-
-$(common-objpfx)errnos: $(wildcard $(sysincludedir)/errno.h \
- $(sysincludedir)/sys/errno.h)
- sed -n 's/^#define[ ]*\(E[A-Z0-9][A-Z0-9]*\)[ ].*$$/\1/p' \
- $^ > $@-tmp
- mv $@-tmp $@
-
-common-generated := $(common-generated) \
- errnos.h errnos make-errnos make-errnos.c
-endif
-
-ifeq (,$(filter-out $(sysdep_dir)/generic/ $(common-objpfx),\
- $(dir $(firstword $(wildcard $(+sysdep_dirs:%=%/bits/ioctls.h))))))
-
-before-compile := $(before-compile) $(common-objpfx)bits/ioctls.h
-
-$(common-objpfx)bits/ioctls.h: $(common-objpfx)make-ioctls
- $(dir $<)$(notdir $<) > $@-tmp
- mv $@-tmp $@
-
-ioctl-includes := sys/termios.h net/nit.h
-ioctl-includes := $(wildcard $(addprefix $(sysincludedir)/,$(ioctl-includes)))
-make-ioctls-CFLAGS := $(subst /,_,$(subst .,_,\
- $(patsubst $(sysincludedir)/%,-DHAVE_%,\
- $(ioctl-includes))))
-
-$(common-objpfx)make-ioctls: $(common-objpfx)make-ioctls.c
- $(common-objdir-compile)
-
-$(common-objpfx)make-ioctls.c: $(sysdep_dir)/unix/ioctls-tmpl.c \
- $(sysdep_dir)/unix/ioctls.awk \
- $(common-objpfx)ioctls
- $(AWK) -f $(word 2,$^) requests="`cat $(word 3,$^)`" $< > $@T
- mv $@T $@
-
-
-bits_termios.h := $(firstword $(wildcard $(+sysdep_dirs:%=%/bits/termios.h)))
-ifeq ($(bits_termios.h),$(sysdep_dir)/generic/bits/termios.h)
-bits_termios.h := # Ignore the generic version.
-endif
-
-# If there is a system-specific <bits/termios.h> file, we want to omit
-# all the symbols it defines from ioctls. Otherwise, both
-# <bits/ioctls.h> and <bits/termios.h> would define them. The
-# system-specific <bits/termios.h> file presumably defines them with
-# the same values as we find from the system's headers. We also want
-# to omit from ioctls the symbols defined in our own
-# <sys/ttydefaults.h>, to avoid multiple definition conflicts. We use
-# snarf-ioctls on these files to find what symbols we want to omit.
-# fgrep -xv gives all lines which do not match in their entirety;
-# without -x, CSTOP's presence elided TIOCSTOP.
-
-$(common-objpfx)ioctls: $(sysdep_dir)/unix/snarf-ioctls \
- $(sysincludedir)/sys/ioctl.h $(ioctl-includes)
- $(dir $<)$(notdir $<) $(filter-out $<,$^) \
- | fgrep -xv "`($(dir $<)$(notdir $<) $(bits_termios.h) \
- $(..)sysdeps/generic/sys/ttydefaults.h; \
- echo NULL) \
- | sort | uniq`" \
- | sort | uniq | tr '\012' ' ' > $@-tmp
- mv $@-tmp $@
-
-common-generated := $(common-generated) \
- bits/ioctls.h ioctls make-ioctls make-ioctls.c
-endif
-
-ifeq (,$(filter-out $(sysdep_dir)/generic/ $(common-objpfx),\
- $(dir $(firstword $(wildcard $(+sysdep_dirs:%=%/sys/syscall.h))))))
-
-# The syscall code assumes a file <sys/syscall.h> that defines macros
-# `SYS_call' for syscall `call'. Variations on this I have seen include:
-# it's in <sys/syscall.h>;
-# it's in <sys.s>;
-# it defines `CALL' instead of `SYS_call'.
-# Irix has a <syscall.h> which is not what we want, so check for <sys.s> first.
-
-# Find a file that might have these. NOTE: This list of possibilities is
-# repeated in sysdeps/unix/configure and the two should be kept in sync.
-syscall.h := $(firstword $(wildcard $(addprefix $(sysincludedir)/, \
- sys.s sys/sys.s \
- sys.S sys/sys.S \
- syscall.h sys/syscall.h \
- )))
-ifdef syscall.h
-
-# Transmogrify any of several formats of the file into the one we want.
-$(common-objpfx)sys/syscall.h: $(syscall.h)
- $(make-target-directory)
- tr '[A-Z]' '[a-z]' < $< | \
- sed -e 's/[ ]sys_/ /' \
- -e 's/^#define[ ]*\([a-z0-9_]*\)[ ]*/#define SYS_\1 /' \
- -e 's/[ ]sys_/ SYS_/' \
- -e 's/SYS_syscall_basenum/syscall_basenum/g' \
- -e 's/SYS_kerncall_basenum/kerncall_basenum/g' \
- -e 's/SYS_sysvoffset/sysvoffset/g' \
- -e '/^#/!d' \
- -e '/^#ident/d' \
- -e 's-\(/\*[^*]*\)$$-\1\*/-' \
- > $@-tmp
- mv $@-tmp $@
-
-before-compile += $(common-objpfx)sys/syscall.h
-common-generated += sys/syscall.h
-
-endif
-
-endif
-
ifndef inhibit-unix-syscalls
# Sysdep dirs unix/... can contain a file syscalls.list,
diff --git a/libc/sysdeps/unix/errnos-tmpl.c b/libc/sysdeps/unix/errnos-tmpl.c
deleted file mode 100644
index 3a9793ead..000000000
--- a/libc/sysdeps/unix/errnos-tmpl.c
+++ /dev/null
@@ -1,98 +0,0 @@
-/* Copyright (C) 1991, 1993, 1997 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <errno.h>
-
-static char iferrno[] = "#ifdef _ERRNO_H";
-static char endiferrno[] = "#endif /* <errno.h> included. */";
-static char ifEmath[] = "#if !defined(__Emath_defined) && \
- (defined(_ERRNO_H) || defined(__need_Emath))";
-static char endifEmath[] = "#endif /* Emath not defined and <errno.h> \
-included or need Emath. */";
-
-static int biggest_value = 0;
-static int done_ENOSYS = 0;
-static int done_ERANGE = 0, done_EDOM = 0;
-
-static void
-DO(name, value)
- char *name;
- int value;
-{
- int is_ERANGE = !done_ERANGE && !strcmp(name, "ERANGE");
- int is_EDOM = !done_EDOM && !strcmp(name, "EDOM");
- int is_Emath = is_ERANGE || is_EDOM;
-
- if (is_Emath)
- {
- puts(endiferrno);
- puts(ifEmath);
- }
-
- if (!strcmp (name, "EWOULDBLOCK"))
- {
- puts ("#define EWOULDBLOCK EAGAIN /* Translated in glibc. */");
- name = "EWOULDBLOCK_sys /* Value actually returned by kernel. */";
- }
-
- printf ("#define %s %d\n", name, value);
-
- if (is_Emath)
- {
- puts(endifEmath);
- puts(iferrno);
- }
-
- if (value > biggest_value)
- biggest_value = value;
-
- if (is_ERANGE)
- done_ERANGE = 1;
- else if (is_EDOM)
- done_EDOM = 1;
- else if (!done_ENOSYS && !strcmp(name, "ENOSYS"))
- done_ENOSYS = 1;
-}
-
-int
-main()
-{
- puts(iferrno);
-
- ERRNOS;
-
- if (!done_EDOM || !done_ERANGE)
- {
- puts(endiferrno);
- puts(ifEmath);
- if (!done_EDOM)
- printf("#define EDOM %d\n", ++biggest_value);
- if (!done_ERANGE)
- printf("#define ERANGE %d\n", ++biggest_value);
- puts(endifEmath);
- }
-
- if (!done_ENOSYS)
- printf("#define ENOSYS %d\n", ++biggest_value);
-
- puts(endiferrno);
-
- puts("#undef __need_Emath");
- puts("#ifndef __Emath_defined\n#define __Emath_defined 1\n#endif");
-
- exit(0);
-}
diff --git a/libc/sysdeps/unix/errnos.awk b/libc/sysdeps/unix/errnos.awk
deleted file mode 100644
index 8648f41fb..000000000
--- a/libc/sysdeps/unix/errnos.awk
+++ /dev/null
@@ -1,12 +0,0 @@
-BEGIN { special = 0 }
-
-/ERRNOS/ { nerrnos = split(errnos, errs)
- for (i = 1; i <= nerrnos; ++i)
- # Some systems define errno codes inside undefined #ifdefs,
- # and then never actually use them.
- printf "#ifdef %s\n DO(\"%s\", %s);\n#endif\n", \
- errs[i], errs[i], errs[i]
- special = 1 }
-
-
-{ if (special == 0) print $0; special = 0 }
diff --git a/libc/sysdeps/unix/ioctls-tmpl.c b/libc/sysdeps/unix/ioctls-tmpl.c
deleted file mode 100644
index 1c973c945..000000000
--- a/libc/sysdeps/unix/ioctls-tmpl.c
+++ /dev/null
@@ -1,134 +0,0 @@
-/* On SVR4, this #define is necessary to make <sys/ioctl.h> define
- many of the ioctls. */
-#define BSD_COMP
-
-#include <sys/types.h>
-#include <sys/param.h>
-
-/* On SunOS 4.1, <sys/ioctl.h> and <sys/termios.h> define some symbols
- with different values, but <sys/termios.h> defines some ioctl symbols
- not in <sys/ioctl.h>, so we need it. Our <sys/ioctl.h> should define
- them with the values from Sun's <sys/ioctl.h>, not <sys/termios.h>.
- So we include <sys/termios.h> and let <sys/ioctl.h> redefine things.
- This produces some spurious warnings. */
-
-#ifdef HAVE_sys_termios_h
-#include <sys/termios.h>
-#endif
-
-/* This causes <sys/ioctl.h> to define some necessary data structure. */
-#ifdef sony_news
-#define KANJI
-#endif
-
-#include <sys/ioctl.h>
-
-#ifdef SIOCGIFCONF
-#include <sys/socket.h>
-#include <sys/time.h>
-#include <net/if.h>
-#include <net/route.h>
-#if defined(SIOCGARP) && !defined(ARPOP_REQUEST)
-#include <net/if_arp.h>
-#endif
-#ifdef SIOCGNIT
-#ifdef HAVE_net_nit_h
-#include <net/nit.h>
-#else /* No net/nit.h. */
-#undef SIOCGNIT
-#undef SIOCSNIT
-#endif /* net/nit.h. */
-#endif /* SIOCGNIT. */
-#endif /* SIOCGIFCONF. */
-
-/* These exist on Sequents. */
-#ifdef SMIOSTATS
-#include <sec/sec.h>
-#include <sec/sm.h>
-#endif
-#ifdef SMIOGETREBOOT0
-#include <i386/cfg.h>
-#endif
-#ifdef ZIOCBCMD
-#include <zdc/zdc.h>
-#endif
-
-/* These exist under Ultrix, but I figured there may be others. */
-#ifdef DIOCGETPT
-#include <ufs/fs.h> /* for DIOC* */
-#endif
-#ifdef DEVGETGEOM
-#include <sys/devio.h>
-#endif
-
-#ifdef ultrix
-/* Ultrix has a conditional include that brings these in; we have to force
- their inclusion when we actually compile them. */
-#undef TCGETA
-#undef TCSETA
-#undef TCSETAW
-#undef TCSETAF
-#undef TCGETP
-#undef TCSANOW
-#undef TCSADRAIN
-#undef TCSAFLUSH
-#ifdef ELSETPID
-#include <sys/un.h> /* get sockaddr_un for elcsd.h */
-#include <elcsd.h>
-#endif
-#ifdef DKIOCDOP
-#include <sys/dkio.h>
-#endif
-/* Couldn't find the header where the structures used by these are
- defined; it looks like an unbundled LAT package or something. */
-#undef LIOCSOL
-#undef LIOCRES
-#undef LIOCCMD
-#undef LIOCINI
-#undef LIOCTTYI
-#undef LIOCCONN
-/* struct mtop hasn't been in sys/mtio.h since 4.1 */
-#undef MTIOCTOP
-#undef MTIOCGET
-#endif
-
-#if defined(__osf__) && defined(__alpha__)
-#include <sys/ioctl_compat.h> /* To get TIOCGETP, etc. */
-#include <alpha/pt.h> /* for DIOC* */
-#include <sys/mtio.h> /* for MTIOC* */
-/* The binlog_getstatus structure doesn't seem to be defined. */
-#undef BINLOG_GETSTATUS
-/* Can't find `struct ifdata' anywhere. */
-#undef SIOCMANREQ
-#undef SIOCGETEVENTS
-/* OSF/1 smells an awful lot like Ultrix. */
-#undef TCGETA
-#undef TCSETA
-#undef TCSETAF
-#undef TCSETAW
-/* This macro looks screwed in sys/devio.h. */
-#undef DEV_DISKPART
-/* This is in sys/dkio.h, but we don't need it. */
-#undef DKIOCACC
-#undef DKIOCDOP
-#undef DKIOCEXCL
-#undef DKIOCGET
-#undef DKIOCHDR
-/* Introduced by OSF/1 2.0. */
-#undef FIOPIPESTAT
-#undef SIOCSRREQR
-#undef SIOCSRREQW
-#undef SRVC_REQUEST
-#endif
-
-#define DEFINE(name, value) \
- printf("#define %s 0x%.8x\n", (name), (value))
-
-int
-main()
-{
- REQUESTS
-
- exit(0);
- return 0;
-}
diff --git a/libc/sysdeps/unix/ioctls.awk b/libc/sysdeps/unix/ioctls.awk
deleted file mode 100644
index b05140af7..000000000
--- a/libc/sysdeps/unix/ioctls.awk
+++ /dev/null
@@ -1,10 +0,0 @@
-BEGIN { special = 0 }
-
-/REQUESTS/ { nreqs = split(requests, reqs)
- for (i = 1; i <= nreqs; ++i)
- printf "#ifdef\t%s\n DEFINE(\"%s\", %s);\n#endif\n", \
- reqs[i], reqs[i], reqs[i]
- special = 1 }
-
-
-{ if (special == 0) print $0; special = 0 }
diff --git a/libc/sysdeps/unix/mk-local_lim.c b/libc/sysdeps/unix/mk-local_lim.c
deleted file mode 100644
index 3ed2426a8..000000000
--- a/libc/sysdeps/unix/mk-local_lim.c
+++ /dev/null
@@ -1,125 +0,0 @@
-/* Copyright (C) 1993, 1996, 1997 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received 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 <sys/types.h>
-
-#ifdef HAVE_SYS_PARAM_H
-#include <sys/param.h>
-#endif
-
-#ifdef HAVE_LIMITS_H
-#include <limits.h>
-#endif
-
-#ifdef HAVE_SYS_LIMITS_H
-#include <sys/limits.h>
-#endif
-
-/* Generate bits/local_lim.h from the values defined in the system's
- headers. */
-
-struct param
- {
- char *name;
- int value;
- };
-
-static struct param params[] =
- {
-
-#if !defined (ARG_MAX) && defined (NCARGS)
-#define ARG_MAX NCARGS
-#endif
-#ifdef ARG_MAX
- { "ARG_MAX", ARG_MAX },
-#endif
-
-#if !defined (CHILD_MAX) && defined (MAXUPRC)
-#define CHILD_MAX MAXUPRC
-#endif
-#ifdef CHILD_MAX
- { "CHILD_MAX", CHILD_MAX },
-#endif
-
-#if !defined (LINK_MAX) && defined (MAXLINK)
-#define LINK_MAX MAXLINK
-#endif
-#ifdef LINK_MAX
- { "LINK_MAX", LINK_MAX },
-#endif
-
-#if !defined (OPEN_MAX) && defined (NOFILE)
-#define OPEN_MAX NOFILE
-#endif
-#ifdef OPEN_MAX
- { "OPEN_MAX", OPEN_MAX },
-#endif
-
-#if !defined (MAX_CANON) && defined (CANBSIZ)
-#define MAX_CANON CANBSIZ
-#endif
-#ifdef MAX_CANON
- { "MAX_CANON", MAX_CANON },
-#endif
-
-#if !defined (NAME_MAX) && defined (MAXNAMLEN)
-#define NAME_MAX MAXNAMLEN
-#endif
-#ifndef NAME_MAX
-#define NAME_MAX 255 /* XXX ? */
-#endif
- { "NAME_MAX", NAME_MAX },
-
-#if !defined (PATH_MAX) && defined (MAXPATHLEN)
-#define PATH_MAX MAXPATHLEN
-#endif
-#ifdef PATH_MAX
- { "PATH_MAX", PATH_MAX },
-#endif
-
-#if !defined (SYMLOOP_MAX) && defined (MAXSYMLINKS)
-#define SYMLOOP_MAX MAXSYMLINKS
-#endif
-#ifdef SYMLOOP_MAX
- { "SYMLOOP_MAX", SYMLOOP_MAX },
-#endif
-
- { NULL, 0 }
- };
-
-int
-main()
-{
- extern char *ctime ();
- extern time_t time ();
- time_t now = time ((time_t *) NULL);
- register struct param *p;
-
- if (! params[0].name)
- /* We have no information to give, so let the caller know. */
- exit (1);
-
- printf ("\
-/* Implementation-specific limits.\n\
- Generated at %.24s. */\n\n", ctime (&now));
-
- for (p = params; p->name != NULL; ++p)
- printf ("#define %s %d\n", p->name, p->value);
-
- exit (0);
-}
diff --git a/libc/sysdeps/unix/snarf-ioctls b/libc/sysdeps/unix/snarf-ioctls
deleted file mode 100755
index a2fc02342..000000000
--- a/libc/sysdeps/unix/snarf-ioctls
+++ /dev/null
@@ -1,48 +0,0 @@
-#!/bin/sh
-# Copyright (C) 1991, 1992, 1995, 1997 Free Software Foundation, Inc.
-# This file is part of the GNU C Library.
-
-# The GNU C Library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-
-# The GNU C Library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-
-# You should have received a copy of the GNU Lesser General Public
-# License along with the GNU C Library; if not, see
-# <http://www.gnu.org/licenses/>.
-
-sysincludedir=${sysincludedir-/usr/include}
-
-if [ ! "$snarfexclude" ]; then
- # Filter out some headers which cause trouble.
- # Reportedly a bug in sunos4.1.2's sed makes this lose if
- # the two cmds are in a single sed invocation.
- snarfexclude="`echo !${sysincludedir}/sys/param.h! \
- !${sysincludedir}/sys/time.h! \
- !${sysincludedir}/sys/types.h! \
- | sed 's,/,\\\\/,g' \
- | sed 's,!\\([^!]*\\)!,-e /\\1/d,g'`"
-fi
-
-for file in $*; do
- sed -n 's/^#define[ ]*\([A-Z][A-Z0-9_]*\)[ ][ ]*[^ ].*$/\1/p' \
- < $file
-
- snarfexclude="$snarfexclude \
- `echo $file | sed -e 's,/,\\\\/,g' -e 's,^.*$,-e /&/d,'`"
- export snarfexclude
-
- included="`sed -n < $file \
- -e 's,^#include[ ]*<\(.*\)>.*$,'${sysincludedir}'/\1,p'\
- | sed $snarfexclude`"
- if [ "$included" ]; then
- $0 $included
- fi
-done
-
-exit 0
diff --git a/libc/sysdeps/unix/sysv/linux/Makefile b/libc/sysdeps/unix/sysv/linux/Makefile
index 06cf6ffab..120d54428 100644
--- a/libc/sysdeps/unix/sysv/linux/Makefile
+++ b/libc/sysdeps/unix/sysv/linux/Makefile
@@ -21,7 +21,6 @@ sysdep_routines += sysctl clone llseek umount umount2 readahead \
setfsuid setfsgid makedev epoll_pwait signalfd \
eventfd eventfd_read eventfd_write prlimit
-
CFLAGS-gethostid.c = -fexceptions
CFLAGS-tst-writev.c += "-DARTIFICIAL_LIMIT=0x80000000-__getpagesize()"
@@ -35,9 +34,7 @@ sysdep_headers += sys/mount.h sys/acct.h sys/sysctl.h \
bits/a.out.h sys/inotify.h sys/signalfd.h sys/eventfd.h \
sys/timerfd.h sys/fanotify.h bits/eventfd.h bits/inotify.h \
bits/signalfd.h bits/timerfd.h bits/epoll.h \
- bits/socket_type.h
-
-install-headers-nosubdir: $(inst_includedir)/bits/syscall.h
+ bits/socket_type.h bits/syscall.h
tests += tst-clone
@@ -63,7 +60,7 @@ ifndef syscall-list-includes
syscall-list-includes := bits/wordsize.h
endif
-$(objpfx)syscall-%.h $(objpfx)syscall-%.d: ../sysdeps/unix/sysv/linux/sys/syscall.h
+$(objpfx)bits/syscall%h $(objpfx)bits/syscall%d: ../sysdeps/unix/sysv/linux/sys/syscall.h
$(make-target-directory)
{ \
echo '/* Generated at libc build time from kernel syscall list. */';\
@@ -98,17 +95,11 @@ endif
rm -f $(foreach v,$(syscall-list-variants),$(@:.h=.d)-t$(v))
mv -f $(@:.h=.d)-t3 $(@:.h=.d)
-$(inst_includedir)/bits/syscall.h: $(objpfx)syscall-list.h $(+force)
- $(make-target-directory)
- if test -r $@ && cmp -s $< $@; \
- then echo 'bits/syscall.h unchanged'; \
- else $(INSTALL_DATA) $< $@; fi
-
ifndef no_deps
# Get the generated list of dependencies (probably /usr/include/asm/unistd.h).
--include $(objpfx)syscall-list.d
+-include $(objpfx)bits/syscall.d
endif
-generated += syscall-list.h syscall-list.d
+generated += bits/syscall.h bits/syscall.d
endif
ifeq ($(subdir),time)
diff --git a/libc/sysdeps/unix/sysv/linux/configure b/libc/sysdeps/unix/sysv/linux/configure
index 33821c0bb..31031613d 100644
--- a/libc/sysdeps/unix/sysv/linux/configure
+++ b/libc/sysdeps/unix/sysv/linux/configure
@@ -393,7 +393,7 @@ case "$prefix" in
# and libc_cv_localedir.
test -n "$libc_cv_slibdir" || \
case $machine in
- sparc/sparc64 | x86_64 | powerpc/powerpc64 | s390/s390-64)
+ sparc/sparc64 | x86_64* | powerpc/powerpc64 | s390/s390-64)
libc_cv_slibdir="/lib64"
if test "$libdir" = '${exec_prefix}/lib'; then
libdir='${exec_prefix}/lib64';
diff --git a/libc/sysdeps/unix/sysv/linux/configure.in b/libc/sysdeps/unix/sysv/linux/configure.in
index 59a13112b..556ca8451 100644
--- a/libc/sysdeps/unix/sysv/linux/configure.in
+++ b/libc/sysdeps/unix/sysv/linux/configure.in
@@ -132,7 +132,7 @@ case "$prefix" in
# and libc_cv_localedir.
test -n "$libc_cv_slibdir" || \
case $machine in
- sparc/sparc64 | x86_64 | powerpc/powerpc64 | s390/s390-64)
+ sparc/sparc64 | x86_64* | powerpc/powerpc64 | s390/s390-64)
libc_cv_slibdir="/lib64"
if test "$libdir" = '${exec_prefix}/lib'; then
libdir='${exec_prefix}/lib64';
diff --git a/libc/sysdeps/unix/sysv/linux/dl-osinfo.h b/libc/sysdeps/unix/sysv/linux/dl-osinfo.h
index 780b20ab6..d0f41a7b2 100644
--- a/libc/sysdeps/unix/sysv/linux/dl-osinfo.h
+++ b/libc/sysdeps/unix/sysv/linux/dl-osinfo.h
@@ -95,9 +95,9 @@ _dl_setup_stack_chk_guard (void *dl_random)
directly and not use the kernel-provided data to seed a PRNG. */
memcpy (ret.bytes, dl_random, sizeof (ret));
#if BYTE_ORDER == LITTLE_ENDIAN
- ret.num &= ~0xff;
+ ret.num &= ~(uintptr_t) 0xff;
#elif BYTE_ORDER == BIG_ENDIAN
- ret.num &= ~(0xff << (8 * (sizeof (ret) - 1)));
+ ret.num &= ~((uintptr_t) 0xff << (8 * (sizeof (ret) - 1)));
#else
# error "BYTE_ORDER unknown"
#endif
diff --git a/libc/sysdeps/unix/sysv/linux/fd_to_filename.h b/libc/sysdeps/unix/sysv/linux/fd_to_filename.h
index feefc2b78..ee939af15 100644
--- a/libc/sysdeps/unix/sysv/linux/fd_to_filename.h
+++ b/libc/sysdeps/unix/sysv/linux/fd_to_filename.h
@@ -19,7 +19,7 @@
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
-#include <stdio-common/_itoa.h>
+#include <_itoa.h>
static inline const char *
fd_to_filename (int fd)
diff --git a/libc/sysdeps/unix/sysv/linux/futimes.c b/libc/sysdeps/unix/sysv/linux/futimes.c
index cd76f6ffb..913bd105f 100644
--- a/libc/sysdeps/unix/sysv/linux/futimes.c
+++ b/libc/sysdeps/unix/sysv/linux/futimes.c
@@ -22,7 +22,7 @@
#include <time.h>
#include <utime.h>
#include <sys/time.h>
-#include <stdio-common/_itoa.h>
+#include <_itoa.h>
#include <fcntl.h>
#include <kernel-features.h>
diff --git a/libc/sysdeps/unix/sysv/linux/i386/readelflib.c b/libc/sysdeps/unix/sysv/linux/i386/readelflib.c
index bdd5e70bc..fab830ef5 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/readelflib.c
+++ b/libc/sysdeps/unix/sysv/linux/i386/readelflib.c
@@ -32,40 +32,52 @@ process_elf_file (const char *file_name, const char *lib, int *flag,
size_t file_length)
{
ElfW(Ehdr) *elf_header = (ElfW(Ehdr) *) file_contents;
- int ret;
+ int ret, file_flag = 0;
- if (elf_header->e_ident [EI_CLASS] == ELFCLASS32)
- return process_elf32_file (file_name, lib, flag, osversion, soname,
- file_contents, file_length);
- else
+ switch (elf_header->e_machine)
{
- switch (elf_header->e_machine)
+ case EM_X86_64:
+ if (elf_header->e_ident[EI_CLASS] == ELFCLASS64)
+ /* X86-64 64bit libraries are always libc.so.6+. */
+ file_flag = FLAG_X8664_LIB64|FLAG_ELF_LIBC6;
+ else
+ /* X32 libraries are always libc.so.6+. */
+ file_flag = FLAG_X8664_LIBX32|FLAG_ELF_LIBC6;
+ break;
+#ifndef SKIP_EM_IA_64
+ case EM_IA_64:
+ if (elf_header->e_ident[EI_CLASS] == ELFCLASS64)
{
- case EM_IA_64:
- case EM_X86_64:
+ /* IA64 64bit libraries are always libc.so.6+. */
+ file_flag = FLAG_IA64_LIB64|FLAG_ELF_LIBC6;
break;
- default:
- error (0, 0, _("%s is for unknown machine %d.\n"),
- file_name, elf_header->e_machine);
- return 1;
}
+ goto failed;
+#endif
+ case EM_386:
+ if (elf_header->e_ident[EI_CLASS] == ELFCLASS32)
+ break;
+ /* Fall through. */
+ default:
+#ifndef SKIP_EM_IA_64
+failed:
+#endif
+ error (0, 0, _("%s is for unknown machine %d.\n"),
+ file_name, elf_header->e_machine);
+ return 1;
+ }
- ret = process_elf64_file (file_name, lib, flag, osversion, soname,
- file_contents, file_length);
- /* IA64/X86-64 64bit libraries are always libc.so.6+. */
- if (!ret)
- switch (elf_header->e_machine)
- {
- case EM_IA_64:
- *flag = FLAG_IA64_LIB64|FLAG_ELF_LIBC6;
- break;
- case EM_X86_64:
- *flag = FLAG_X8664_LIB64|FLAG_ELF_LIBC6;
- break;
- }
+ if (elf_header->e_ident[EI_CLASS] == ELFCLASS32)
+ ret = process_elf32_file (file_name, lib, flag, osversion, soname,
+ file_contents, file_length);
+ else
+ ret = process_elf64_file (file_name, lib, flag, osversion, soname,
+ file_contents, file_length);
- return ret;
- }
+ if (!ret && file_flag)
+ *flag = file_flag;
+
+ return ret;
}
#undef __ELF_NATIVE_CLASS
diff --git a/libc/sysdeps/unix/sysv/linux/i386/register-dump.h b/libc/sysdeps/unix/sysv/linux/i386/register-dump.h
index d2c5c3fca..7f54f6743 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/register-dump.h
+++ b/libc/sysdeps/unix/sysv/linux/i386/register-dump.h
@@ -18,7 +18,7 @@
<http://www.gnu.org/licenses/>. */
#include <sys/uio.h>
-#include <stdio-common/_itoa.h>
+#include <_itoa.h>
/* We will print the register dump in this format:
diff --git a/libc/sysdeps/unix/sysv/linux/kernel-features.h b/libc/sysdeps/unix/sysv/linux/kernel-features.h
index 3125be313..ffaae5d14 100644
--- a/libc/sysdeps/unix/sysv/linux/kernel-features.h
+++ b/libc/sysdeps/unix/sysv/linux/kernel-features.h
@@ -273,11 +273,11 @@
their availability with one define. The changes were made first
for i386 and the have to be done separately for the other archs.
For i386 we pick 2.5.50 as the first version with support.
- For s390*, PPC, x86-64, and SH we pick 2.5.64 as the first
+ For s390*, SPARC, PPC, x86-64, and SH we pick 2.5.64 as the first
version with support. */
#if ((__LINUX_KERNEL_VERSION >= 132402 && defined __i386__) \
|| (__LINUX_KERNEL_VERSION >= 132416 \
- && (defined __s390__ \
+ && (defined __s390__ || defined __sparc__ \
|| defined __powerpc__ || defined __x86_64__ || defined __sh__)))
# define __ASSUME_CLONE_THREAD_FLAGS 1
#endif
@@ -322,11 +322,11 @@
#endif
/* The tgkill syscall was instroduced for i386 in 2.5.75. On x86-64,
- ppc, and ppc64 it was introduced in 2.6.0-test3. */
+ sparc, SH, ppc, and ppc64 it was introduced in 2.6.0-test3. */
#if (__LINUX_KERNEL_VERSION >= 132427 && defined __i386__) \
- || (__LINUX_KERNEL_VERSION >= 132609 && defined __x86_64__) \
- || (__LINUX_KERNEL_VERSION >= 132609 && defined __powerpc__) \
- || (__LINUX_KERNEL_VERSION >= 132609 && defined __sh__)
+ || (__LINUX_KERNEL_VERSION >= 132609 \
+ && (defined __x86_64__ || defined __powerpc__ \
+ || defined __sh__ || defined __sparc__))
# define __ASSUME_TGKILL 1
#endif
@@ -350,9 +350,10 @@
#endif
/* The fixed version of the posix_fadvise64 syscall appeared in
- 2.6.0-test3. At least for x86. Powerpc support appeared in
- 2.6.2, but for 32-bit userspace only. */
-#if (__LINUX_KERNEL_VERSION >= 132609 && defined __i386__) \
+ 2.6.0-test3. At least for x86 and sparc. Powerpc support appeared
+ in 2.6.2, but for 32-bit userspace only. */
+#if (__LINUX_KERNEL_VERSION >= 132609 \
+ && (defined __i386__ || defined __sparc__)) \
|| (__LINUX_KERNEL_VERSION >= 132610 && defined __powerpc__ \
&& !defined __powerpc64__)
# define __ASSUME_FADVISE64_64_SYSCALL 1
diff --git a/libc/sysdeps/unix/sysv/linux/openat.c b/libc/sysdeps/unix/sysv/linux/openat.c
index 11e673fe6..62ea1e3c9 100644
--- a/libc/sysdeps/unix/sysv/linux/openat.c
+++ b/libc/sysdeps/unix/sysv/linux/openat.c
@@ -84,7 +84,6 @@ OPENAT_NOT_CANCEL (fd, file, oflag, mode)
oflag |= MORE_OFLAGS;
#endif
- INTERNAL_SYSCALL_DECL (err);
int res;
#ifdef __NR_openat
@@ -104,6 +103,7 @@ OPENAT_NOT_CANCEL (fd, file, oflag, mode)
#endif
#ifndef __ASSUME_ATFCTS
+ INTERNAL_SYSCALL_DECL (err);
char *buf = NULL;
if (fd != AT_FDCWD && file[0] != '/')
diff --git a/libc/sysdeps/unix/sysv/linux/ptsname.c b/libc/sysdeps/unix/sysv/linux/ptsname.c
index 41edd8f8f..fb097698f 100644
--- a/libc/sysdeps/unix/sysv/linux/ptsname.c
+++ b/libc/sysdeps/unix/sysv/linux/ptsname.c
@@ -26,7 +26,7 @@
#include <termios.h>
#include <unistd.h>
-#include <stdio-common/_itoa.h>
+#include <_itoa.h>
/* Check if DEV corresponds to a master pseudo terminal device. */
#define MASTER_P(Dev) \
diff --git a/libc/sysdeps/unix/sysv/linux/s390/s390-32/register-dump.h b/libc/sysdeps/unix/sysv/linux/s390/s390-32/register-dump.h
index 0c3b83c24..1f1a85983 100644
--- a/libc/sysdeps/unix/sysv/linux/s390/s390-32/register-dump.h
+++ b/libc/sysdeps/unix/sysv/linux/s390/s390-32/register-dump.h
@@ -18,7 +18,7 @@
<http://www.gnu.org/licenses/>. */
#include <sys/uio.h>
-#include <stdio-common/_itoa.h>
+#include <_itoa.h>
/* We will print the register dump in this format:
diff --git a/libc/sysdeps/unix/sysv/linux/s390/s390-64/register-dump.h b/libc/sysdeps/unix/sysv/linux/s390/s390-64/register-dump.h
index 0cf89f14c..671481df7 100644
--- a/libc/sysdeps/unix/sysv/linux/s390/s390-64/register-dump.h
+++ b/libc/sysdeps/unix/sysv/linux/s390/s390-64/register-dump.h
@@ -18,7 +18,7 @@
<http://www.gnu.org/licenses/>. */
#include <sys/uio.h>
-#include <stdio-common/_itoa.h>
+#include <_itoa.h>
/* We will print the register dump in this format:
diff --git a/libc/sysdeps/unix/sysv/linux/sh/sh3/register-dump.h b/libc/sysdeps/unix/sysv/linux/sh/sh3/register-dump.h
index 9562882ed..510863e7b 100644
--- a/libc/sysdeps/unix/sysv/linux/sh/sh3/register-dump.h
+++ b/libc/sysdeps/unix/sysv/linux/sh/sh3/register-dump.h
@@ -17,7 +17,7 @@
<http://www.gnu.org/licenses/>. */
#include <sys/uio.h>
-#include <stdio-common/_itoa.h>
+#include <_itoa.h>
/* We will print the register dump in this format:
diff --git a/libc/sysdeps/unix/sysv/linux/sh/sh4/register-dump.h b/libc/sysdeps/unix/sysv/linux/sh/sh4/register-dump.h
index d31ca1f91..f05447c37 100644
--- a/libc/sysdeps/unix/sysv/linux/sh/sh4/register-dump.h
+++ b/libc/sysdeps/unix/sysv/linux/sh/sh4/register-dump.h
@@ -17,7 +17,7 @@
<http://www.gnu.org/licenses/>. */
#include <sys/uio.h>
-#include <stdio-common/_itoa.h>
+#include <_itoa.h>
/* We will print the register dump in this format:
diff --git a/libc/sysdeps/unix/sysv/linux/shmat.c b/libc/sysdeps/unix/sysv/linux/shmat.c
index 2eec6a6e6..d01bb1bdb 100644
--- a/libc/sysdeps/unix/sysv/linux/shmat.c
+++ b/libc/sysdeps/unix/sysv/linux/shmat.c
@@ -35,7 +35,8 @@ shmat (shmid, shmaddr, shmflg)
const void *shmaddr;
int shmflg;
{
- void *__unbounded result;
+ INTERNAL_SYSCALL_DECL(err);
+ unsigned long resultvar;
void *__unbounded raddr;
#if __BOUNDED_POINTERS__
@@ -47,12 +48,15 @@ shmat (shmid, shmaddr, shmflg)
length = shmds.shm_segsz;
#endif
- result = (void *__unbounded) INLINE_SYSCALL (ipc, 5, IPCOP_shmat,
- shmid, shmflg,
- (long int) __ptrvalue (&raddr),
- __ptrvalue ((void *) shmaddr));
- if ((unsigned long) result <= -(unsigned long) SHMLBA)
- result = raddr;
-
- return BOUNDED_N (result, length);
+ resultvar = INTERNAL_SYSCALL (ipc, err, 5, IPCOP_shmat,
+ shmid, shmflg,
+ (long int) __ptrvalue (&raddr),
+ __ptrvalue ((void *) shmaddr));
+ if (INTERNAL_SYSCALL_ERROR_P (resultvar, err))
+ {
+ __set_errno (INTERNAL_SYSCALL_ERRNO (resultvar, err));
+ return (void *) -1l;
+ }
+
+ return BOUNDED_N (raddr, length);
}
diff --git a/libc/sysdeps/unix/sysv/linux/sparc/Makefile b/libc/sysdeps/unix/sysv/linux/sparc/Makefile
index 96bf0bbd1..d769c4852 100644
--- a/libc/sysdeps/unix/sysv/linux/sparc/Makefile
+++ b/libc/sysdeps/unix/sysv/linux/sparc/Makefile
@@ -7,3 +7,7 @@ syscall-list-64bit-condition := __WORDSIZE == 64
ifeq ($(subdir),rt)
librt-routines += rt-sysdep
endif
+
+ifeq ($(subdir),sysvipc)
+sysdep_routines += getshmlba
+endif
diff --git a/libc/sysdeps/unix/sysv/linux/sparc/Versions b/libc/sysdeps/unix/sysv/linux/sparc/Versions
index 3da1a25be..5d31d1d14 100644
--- a/libc/sysdeps/unix/sysv/linux/sparc/Versions
+++ b/libc/sysdeps/unix/sysv/linux/sparc/Versions
@@ -26,6 +26,8 @@ libc {
GLIBC_2.16 {
#errlist-compat 136
_sys_errlist; sys_errlist; _sys_nerr; sys_nerr;
+
+ __getshmlba;
}
}
librt {
diff --git a/libc/sysdeps/unix/sysv/linux/sparc/bits/shm.h b/libc/sysdeps/unix/sysv/linux/sparc/bits/shm.h
index b0966d61c..eb530de98 100644
--- a/libc/sysdeps/unix/sysv/linux/sparc/bits/shm.h
+++ b/libc/sysdeps/unix/sysv/linux/sparc/bits/shm.h
@@ -40,8 +40,8 @@
__BEGIN_DECLS
/* Segment low boundary address multiple. */
-#define SHMLBA (__getpagesize ())
-extern int __getpagesize (void) __THROW __attribute__ ((__const__));
+#define SHMLBA (__getshmlba ())
+extern int __getshmlba (void) __attribute__ ((__const__));
/* Type to count number of attaches. */
diff --git a/libc/sysdeps/unix/sysv/linux/sparc/getshmlba.c b/libc/sysdeps/unix/sysv/linux/sparc/getshmlba.c
new file mode 100644
index 000000000..205bed272
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/sparc/getshmlba.c
@@ -0,0 +1,40 @@
+/* Copyright (C) 2012
+ Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <unistd.h>
+#include <sys/shm.h>
+#include <ldsodefs.h>
+
+int
+__getshmlba (void)
+{
+ uint64_t hwcap = GLRO(dl_hwcap);
+ int pgsz = GLRO(dl_pagesize);
+
+ if (hwcap & HWCAP_SPARC_V9)
+ {
+ if (pgsz < (16 * 1024))
+ return 16 * 1024;
+ else
+ return pgsz;
+ }
+ else if (!(hwcap & HWCAP_SPARC_FLUSH))
+ return 64 * 1024;
+ else
+ return 256 * 1024;
+}
diff --git a/libc/sysdeps/unix/sysv/linux/sparc/sparc32/register-dump.h b/libc/sysdeps/unix/sysv/linux/sparc/sparc32/register-dump.h
index 0d0cdd6bb..be6ad74ae 100644
--- a/libc/sysdeps/unix/sysv/linux/sparc/sparc32/register-dump.h
+++ b/libc/sysdeps/unix/sysv/linux/sparc/sparc32/register-dump.h
@@ -18,7 +18,7 @@
<http://www.gnu.org/licenses/>. */
#include <sys/uio.h>
-#include <stdio-common/_itoa.h>
+#include <_itoa.h>
/* We will print the register dump in this format:
diff --git a/libc/sysdeps/unix/sysv/linux/sparc/sparc64/dl-fxstatat64.c b/libc/sysdeps/unix/sysv/linux/sparc/sparc64/dl-fxstatat64.c
new file mode 100644
index 000000000..339e5f433
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/sparc/sparc64/dl-fxstatat64.c
@@ -0,0 +1,6 @@
+/* In this implementation we do not really care whether the call fails
+ because of missing kernel support since we do not even call the
+ function in this case. */
+#undef __ASSUME_ATFCTS
+#define __ASSUME_ATFCTS 1
+#include "fxstatat.c"
diff --git a/libc/sysdeps/unix/sysv/linux/sparc/sparc64/makecontext.c b/libc/sysdeps/unix/sysv/linux/sparc/sparc64/makecontext.c
index 3bb4e7a28..e925040d1 100644
--- a/libc/sysdeps/unix/sysv/linux/sparc/sparc64/makecontext.c
+++ b/libc/sysdeps/unix/sysv/linux/sparc/sparc64/makecontext.c
@@ -29,9 +29,9 @@ __makecontext (ucontext_t *ucp, void (*func) (void), int argc, ...)
va_list ap;
int i;
- sp = (long *) ((long) ucp->uc_stack.ss_sp + ucp->uc_stack.ss_size);
+ sp = (unsigned long *) ((long) ucp->uc_stack.ss_sp + ucp->uc_stack.ss_size);
sp -= (argc > 6 ? argc : 6) + 32;
- sp = (long *) (((long) sp) & -16L);
+ sp = (unsigned long *) (((long) sp) & -16L);
topsp = sp + (argc > 6 ? argc : 6) + 16;
ucp->uc_mcontext.mc_gregs[MC_PC] = (long) func;
diff --git a/libc/sysdeps/unix/sysv/linux/sparc/sparc64/register-dump.h b/libc/sysdeps/unix/sysv/linux/sparc/sparc64/register-dump.h
index 8ef6fde2f..d8e76264f 100644
--- a/libc/sysdeps/unix/sysv/linux/sparc/sparc64/register-dump.h
+++ b/libc/sysdeps/unix/sysv/linux/sparc/sparc64/register-dump.h
@@ -18,7 +18,7 @@
<http://www.gnu.org/licenses/>. */
#include <sys/uio.h>
-#include <stdio-common/_itoa.h>
+#include <_itoa.h>
/* We will print the register dump in this format:
diff --git a/libc/sysdeps/unix/sysv/linux/sparc/sysdep.h b/libc/sysdeps/unix/sysv/linux/sparc/sysdep.h
index 542e94040..fc955c236 100644
--- a/libc/sysdeps/unix/sysv/linux/sparc/sysdep.h
+++ b/libc/sysdeps/unix/sysv/linux/sparc/sysdep.h
@@ -22,13 +22,13 @@
#undef INLINE_SYSCALL
#define INLINE_SYSCALL(name, nr, args...) \
({ INTERNAL_SYSCALL_DECL(err); \
- unsigned int resultvar = INTERNAL_SYSCALL(name, err, nr, args); \
+ unsigned long resultvar = INTERNAL_SYSCALL(name, err, nr, args);\
if (INTERNAL_SYSCALL_ERROR_P (resultvar, err)) \
{ \
__set_errno (INTERNAL_SYSCALL_ERRNO (resultvar, err)); \
- resultvar = 0xffffffff; \
+ resultvar = (unsigned long) -1; \
} \
- (int) resultvar; \
+ (long) resultvar; \
})
#undef INTERNAL_SYSCALL_DECL
diff --git a/libc/sysdeps/unix/sysv/linux/ttyname.c b/libc/sysdeps/unix/sysv/linux/ttyname.c
index 70b2d51a0..0cfb4740b 100644
--- a/libc/sysdeps/unix/sysv/linux/ttyname.c
+++ b/libc/sysdeps/unix/sysv/linux/ttyname.c
@@ -27,7 +27,7 @@
#include <string.h>
#include <stdlib.h>
-#include <stdio-common/_itoa.h>
+#include <_itoa.h>
#include <kernel-features.h>
#if 0
diff --git a/libc/sysdeps/unix/sysv/linux/ttyname_r.c b/libc/sysdeps/unix/sysv/linux/ttyname_r.c
index a12849a77..f097311a1 100644
--- a/libc/sysdeps/unix/sysv/linux/ttyname_r.c
+++ b/libc/sysdeps/unix/sysv/linux/ttyname_r.c
@@ -27,7 +27,7 @@
#include <string.h>
#include <stdlib.h>
-#include <stdio-common/_itoa.h>
+#include <_itoa.h>
#include <kernel-features.h>
static int getttyname_r (char *buf, size_t buflen,
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/dl-cache.h b/libc/sysdeps/unix/sysv/linux/x86_64/dl-cache.h
index 8463fea3d..e14151d42 100644
--- a/libc/sysdeps/unix/sysv/linux/x86_64/dl-cache.h
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/dl-cache.h
@@ -21,4 +21,31 @@
#define _dl_cache_check_flags(flags) \
((flags) == _DL_CACHE_DEFAULT_ID)
-#include <sysdeps/unix/sysv/linux/sparc/dl-cache.h>
+#define add_system_dir(dir) \
+ do \
+ { \
+ size_t len = strlen (dir); \
+ char path[len + 4]; \
+ memcpy (path, dir, len + 1); \
+ if (len >= 6 && ! memcmp (path + len - 6, "/lib64", 6)) \
+ { \
+ len -= 2; \
+ path[len] = '\0'; \
+ } \
+ else if (len >= 7 \
+ && ! memcmp (path + len - 7, "/libx32", 7)) \
+ { \
+ len -= 3; \
+ path[len] = '\0'; \
+ } \
+ add_dir (path); \
+ if (len >= 4 && ! memcmp (path + len - 4, "/lib", 4)) \
+ { \
+ memcpy (path + len, "64", 3); \
+ add_dir (path); \
+ memcpy (path + len, "x32", 4); \
+ add_dir (path); \
+ } \
+ } while (0)
+
+#include <sysdeps/generic/dl-cache.h>
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/ldconfig.h b/libc/sysdeps/unix/sysv/linux/x86_64/ldconfig.h
index af4d1b5ad..6f5b828f4 100644
--- a/libc/sysdeps/unix/sysv/linux/x86_64/ldconfig.h
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/ldconfig.h
@@ -19,6 +19,7 @@
#define SYSDEP_KNOWN_INTERPRETER_NAMES \
{ "/lib/ld-linux.so.2", FLAG_ELF_LIBC6 }, \
+ { "/libx32/ld-linux-x32.so.2", FLAG_ELF_LIBC6 }, \
{ "/lib64/ld-linux-x86-64.so.2", FLAG_ELF_LIBC6 },
#define SYSDEP_KNOWN_LIBRARY_NAMES \
{ "libc.so.6", FLAG_ELF_LIBC6 }, \
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/ldd-rewrite.sed b/libc/sysdeps/unix/sysv/linux/x86_64/ldd-rewrite.sed
index 3f1530d31..44d76e8aa 100644
--- a/libc/sysdeps/unix/sysv/linux/x86_64/ldd-rewrite.sed
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/ldd-rewrite.sed
@@ -1,3 +1,3 @@
/LD_TRACE_LOADED_OBJECTS=1/a\
add_env="$add_env LD_LIBRARY_VERSION=\\$verify_out"
-s_^\(RTLDLIST=\)\(.*lib\)\(\|64\)\(/[^/]*\)\(-x86-64\)\(\.so\.[0-9.]*\)[ ]*$_\1"\2\4\6 \264\4\5\6"_
+s_^\(RTLDLIST=\)\(.*lib\)\(\|64\|x32\)\(/[^/]*\)\(-x86-64\|-x32\)\(\.so\.[0-9.]*\)[ ]*$_\1"\2\4\6 \264\4-x86-64\6 \2x32\4-x32\6"_
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/makecontext.c b/libc/sysdeps/unix/sysv/linux/x86_64/makecontext.c
index 860925f46..54730312a 100644
--- a/libc/sysdeps/unix/sysv/linux/x86_64/makecontext.c
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/makecontext.c
@@ -52,29 +52,30 @@ void
__makecontext (ucontext_t *ucp, void (*func) (void), int argc, ...)
{
extern void __start_context (void);
- unsigned long int *sp, idx_uc_link;
+ greg_t *sp;
+ unsigned int idx_uc_link;
va_list ap;
int i;
/* Generate room on stack for parameter if needed and uc_link. */
- sp = (unsigned long int *) ((uintptr_t) ucp->uc_stack.ss_sp
- + ucp->uc_stack.ss_size);
+ sp = (greg_t *) ((uintptr_t) ucp->uc_stack.ss_sp
+ + ucp->uc_stack.ss_size);
sp -= (argc > 6 ? argc - 6 : 0) + 1;
/* Align stack and make space for trampoline address. */
- sp = (unsigned long int *) ((((uintptr_t) sp) & -16L) - 8);
+ sp = (greg_t *) ((((uintptr_t) sp) & -16L) - 8);
idx_uc_link = (argc > 6 ? argc - 6 : 0) + 1;
/* Setup context ucp. */
/* Address to jump to. */
- ucp->uc_mcontext.gregs[REG_RIP] = (long int) func;
+ ucp->uc_mcontext.gregs[REG_RIP] = (uintptr_t) func;
/* Setup rbx.*/
- ucp->uc_mcontext.gregs[REG_RBX] = (long int) &sp[idx_uc_link];
- ucp->uc_mcontext.gregs[REG_RSP] = (long int) sp;
+ ucp->uc_mcontext.gregs[REG_RBX] = (uintptr_t) &sp[idx_uc_link];
+ ucp->uc_mcontext.gregs[REG_RSP] = (uintptr_t) sp;
/* Setup stack. */
- sp[0] = (unsigned long int) &__start_context;
- sp[idx_uc_link] = (unsigned long int) ucp->uc_link;
+ sp[0] = (uintptr_t) &__start_context;
+ sp[idx_uc_link] = (uintptr_t) ucp->uc_link;
va_start (ap, argc);
/* Handle arguments.
@@ -90,26 +91,26 @@ __makecontext (ucontext_t *ucp, void (*func) (void), int argc, ...)
switch (i)
{
case 0:
- ucp->uc_mcontext.gregs[REG_RDI] = va_arg (ap, long int);
+ ucp->uc_mcontext.gregs[REG_RDI] = va_arg (ap, greg_t);
break;
case 1:
- ucp->uc_mcontext.gregs[REG_RSI] = va_arg (ap, long int);
+ ucp->uc_mcontext.gregs[REG_RSI] = va_arg (ap, greg_t);
break;
case 2:
- ucp->uc_mcontext.gregs[REG_RDX] = va_arg (ap, long int);
+ ucp->uc_mcontext.gregs[REG_RDX] = va_arg (ap, greg_t);
break;
case 3:
- ucp->uc_mcontext.gregs[REG_RCX] = va_arg (ap, long int);
+ ucp->uc_mcontext.gregs[REG_RCX] = va_arg (ap, greg_t);
break;
case 4:
- ucp->uc_mcontext.gregs[REG_R8] = va_arg (ap, long int);
+ ucp->uc_mcontext.gregs[REG_R8] = va_arg (ap, greg_t);
break;
case 5:
- ucp->uc_mcontext.gregs[REG_R9] = va_arg (ap, long int);
+ ucp->uc_mcontext.gregs[REG_R9] = va_arg (ap, greg_t);
break;
default:
/* Put value on stack. */
- sp[i - 5] = va_arg (ap, unsigned long int);
+ sp[i - 5] = va_arg (ap, greg_t);
break;
}
va_end (ap);
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/readelflib.c b/libc/sysdeps/unix/sysv/linux/x86_64/readelflib.c
index 7aa68ff7e..4c4e5f9d1 100644
--- a/libc/sysdeps/unix/sysv/linux/x86_64/readelflib.c
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/readelflib.c
@@ -1,61 +1,2 @@
-/* Copyright (C) 1999, 2001, 2002, 2005 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Andreas Jaeger <aj@suse.de>, 1999 and
- Jakub Jelinek <jakub@redhat.com>, 1999.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-
-int process_elf32_file (const char *file_name, const char *lib, int *flag,
- unsigned int *osversion, char **soname,
- void *file_contents, size_t file_length);
-int process_elf64_file (const char *file_name, const char *lib, int *flag,
- unsigned int *osversion, char **soname,
- void *file_contents, size_t file_length);
-
-/* Returns 0 if everything is ok, != 0 in case of error. */
-int
-process_elf_file (const char *file_name, const char *lib, int *flag,
- unsigned int *osversion, char **soname, void *file_contents,
- size_t file_length)
-{
- ElfW(Ehdr) *elf_header = (ElfW(Ehdr) *) file_contents;
- int ret;
-
- if (elf_header->e_ident [EI_CLASS] == ELFCLASS32)
- return process_elf32_file (file_name, lib, flag, osversion, soname,
- file_contents, file_length);
- else
- {
- ret = process_elf64_file (file_name, lib, flag, osversion, soname,
- file_contents, file_length);
- /* x86-64 64bit libraries are always libc.so.6+. */
- if (!ret)
- *flag = FLAG_X8664_LIB64|FLAG_ELF_LIBC6;
- return ret;
- }
-}
-
-#undef __ELF_NATIVE_CLASS
-#undef process_elf_file
-#define process_elf_file process_elf32_file
-#define __ELF_NATIVE_CLASS 32
-#include "elf/readelflib.c"
-
-#undef __ELF_NATIVE_CLASS
-#undef process_elf_file
-#define process_elf_file process_elf64_file
-#define __ELF_NATIVE_CLASS 64
-#include "elf/readelflib.c"
+#define SKIP_EM_IA_64
+#include <sysdeps/unix/sysv/linux/i386/readelflib.c>
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/register-dump.h b/libc/sysdeps/unix/sysv/linux/x86_64/register-dump.h
index 83157916d..3ef8e09b6 100644
--- a/libc/sysdeps/unix/sysv/linux/x86_64/register-dump.h
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/register-dump.h
@@ -17,7 +17,7 @@
<http://www.gnu.org/licenses/>. */
#include <sys/uio.h>
-#include <stdio-common/_itoa.h>
+#include <_itoa.h>
/* We will print the register dump in this format:
diff --git a/libc/sysdeps/x86_64/bits/atomic.h b/libc/sysdeps/x86_64/bits/atomic.h
index 4b8d2ab09..100943fa1 100644
--- a/libc/sysdeps/x86_64/bits/atomic.h
+++ b/libc/sysdeps/x86_64/bits/atomic.h
@@ -101,8 +101,8 @@ typedef uintmax_t uatomic_max_t;
"lock\n" \
"0:\tcmpxchgq %q2, %1" \
: "=a" (ret), "=m" (*mem) \
- : "q" ((long int) (newval)), "m" (*mem), \
- "0" ((long int)oldval), \
+ : "q" ((atomic64_t) (newval)), "m" (*mem), \
+ "0" ((atomic64_t) (oldval)), \
"i" (offsetof (tcbhead_t, multiple_threads))); \
ret; })
@@ -125,7 +125,7 @@ typedef uintmax_t uatomic_max_t;
else \
__asm __volatile ("xchgq %q0, %1" \
: "=r" (result), "=m" (*mem) \
- : "0" ((long) (newvalue)), "m" (*mem)); \
+ : "0" ((atomic64_t) (newvalue)), "m" (*mem)); \
result; })
@@ -149,7 +149,7 @@ typedef uintmax_t uatomic_max_t;
else \
__asm __volatile (lock "xaddq %q0, %1" \
: "=r" (result), "=m" (*mem) \
- : "0" ((long) (value)), "m" (*mem), \
+ : "0" ((atomic64_t) (value)), "m" (*mem), \
"i" (offsetof (tcbhead_t, multiple_threads))); \
result; })
@@ -187,7 +187,7 @@ typedef uintmax_t uatomic_max_t;
else \
__asm __volatile (lock "addq %q1, %0" \
: "=m" (*mem) \
- : "ir" ((long) (value)), "m" (*mem), \
+ : "ir" ((atomic64_t) (value)), "m" (*mem), \
"i" (offsetof (tcbhead_t, multiple_threads))); \
} while (0)
@@ -218,7 +218,7 @@ typedef uintmax_t uatomic_max_t;
else \
__asm __volatile (LOCK_PREFIX "addq %q2, %0; sets %1" \
: "=m" (*mem), "=qm" (__result) \
- : "ir" ((long) (value)), "m" (*mem)); \
+ : "ir" ((atomic64_t) (value)), "m" (*mem)); \
__result; })
@@ -239,7 +239,7 @@ typedef uintmax_t uatomic_max_t;
else \
__asm __volatile (LOCK_PREFIX "addq %q2, %0; setz %1" \
: "=m" (*mem), "=qm" (__result) \
- : "ir" ((long) (value)), "m" (*mem)); \
+ : "ir" ((atomic64_t) (value)), "m" (*mem)); \
__result; })
diff --git a/libc/sysdeps/x86_64/bits/mathdef.h b/libc/sysdeps/x86_64/bits/mathdef.h
index 846a350a0..c202ad592 100644
--- a/libc/sysdeps/x86_64/bits/mathdef.h
+++ b/libc/sysdeps/x86_64/bits/mathdef.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001, 2004, 2010 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2012 Free Software 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,7 @@
#if defined __USE_ISOC99 && defined _MATH_H && !defined _MATH_H_MATHDEF
# define _MATH_H_MATHDEF 1
-# include <bits/wordsize.h>
-
-# if __WORDSIZE == 64 || (defined __FLT_EVAL_METHOD__ && __FLT_EVAL_METHOD__ == 0)
+# if defined __x86_64__ || (defined __FLT_EVAL_METHOD__ && __FLT_EVAL_METHOD__ == 0)
/* The x86-64 architecture computes values with the precission of the
used type. Similarly for -m32 -mfpmath=sse. */
typedef float float_t; /* `float' expressions are evaluated as `float'. */
diff --git a/libc/sysdeps/x86_64/bits/setjmp.h b/libc/sysdeps/x86_64/bits/setjmp.h
index a66ca0fa5..bb6920d44 100644
--- a/libc/sysdeps/x86_64/bits/setjmp.h
+++ b/libc/sysdeps/x86_64/bits/setjmp.h
@@ -29,6 +29,8 @@
# if __WORDSIZE == 64
typedef long int __jmp_buf[8];
+# elif defined __x86_64__
+typedef long long int __jmp_buf[8];
# else
typedef int __jmp_buf[6];
# endif
diff --git a/libc/sysdeps/x86_64/elf/start.S b/libc/sysdeps/x86_64/elf/start.S
index 68d61e234..5e01d2117 100644
--- a/libc/sysdeps/x86_64/elf/start.S
+++ b/libc/sysdeps/x86_64/elf/start.S
@@ -1,5 +1,5 @@
/* Startup code compliant to the ELF x86-64 ABI.
- Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
+ Copyright (C) 2001-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@suse.de>, 2001.
@@ -53,12 +53,16 @@
NULL
*/
+#include <sysdep.h>
#include "bp-sym.h"
.text
.globl _start
.type _start,@function
_start:
+ cfi_startproc
+ /* Clearing frame pointer is insufficient, use CFI. */
+ cfi_undefined (rip)
/* Clear the frame pointer. The ABI suggests this be done, to mark
the outermost frame obviously. */
xorl %ebp, %ebp
@@ -113,6 +117,7 @@ _start:
#endif
hlt /* Crash if somehow `exit' does return. */
+ cfi_endproc
/* Define a symbol for the first piece of initialized data. */
.data
diff --git a/libc/sysdeps/x86_64/ffsll.c b/libc/sysdeps/x86_64/ffsll.c
index 280877086..a7a5dc858 100644
--- a/libc/sysdeps/x86_64/ffsll.c
+++ b/libc/sysdeps/x86_64/ffsll.c
@@ -1,7 +1,7 @@
/* ffsll -- find first set bit in a word, counted from least significant end.
For AMD x86-64.
This file is part of the GNU C Library.
- Copyright (C) 1991,92,93,94,97,98,2001 Free Software Foundation, Inc.
+ Copyright (C) 1991-2012 Free Software Foundation, Inc.
Contributed by Ulrich Drepper <drepper@cygnus.com>.
The GNU C Library is free software; you can redistribute it and/or
@@ -36,5 +36,7 @@ ffsll (long long int x)
return cnt + 1;
}
+#ifdef __LP64__
#undef ffsl
weak_alias (ffsll, ffsl)
+#endif
diff --git a/libc/sysdeps/x86_64/fpu/bits/fenv.h b/libc/sysdeps/x86_64/fpu/bits/fenv.h
index 502437676..bb790c936 100644
--- a/libc/sysdeps/x86_64/fpu/bits/fenv.h
+++ b/libc/sysdeps/x86_64/fpu/bits/fenv.h
@@ -19,9 +19,6 @@
# error "Never use <bits/fenv.h> directly; include <fenv.h> instead."
#endif
-#include <bits/wordsize.h>
-
-
/* Define bits representing the exception. We use the bit positions
of the appropriate bits in the FPU control word. */
enum
@@ -81,7 +78,7 @@ typedef struct
unsigned int __data_offset;
unsigned short int __data_selector;
unsigned short int __unused5;
-#if __WORDSIZE == 64
+#ifdef __x86_64__
unsigned int __mxcsr;
#endif
}
diff --git a/libc/sysdeps/x86_64/fpu/bits/mathinline.h b/libc/sysdeps/x86_64/fpu/bits/mathinline.h
index 5a9ce8b1b..c072f16a2 100644
--- a/libc/sysdeps/x86_64/fpu/bits/mathinline.h
+++ b/libc/sysdeps/x86_64/fpu/bits/mathinline.h
@@ -20,8 +20,6 @@
# error "Never use <bits/mathinline.h> directly; include <math.h> instead."
#endif
-#include <bits/wordsize.h>
-
#ifndef __extern_always_inline
# define __MATH_INLINE __inline
#else
@@ -38,7 +36,7 @@ __BEGIN_NAMESPACE_C99
__MATH_INLINE int
__NTH (__signbitf (float __x))
{
-# if __WORDSIZE == 32
+# ifndef __x86_64__
__extension__ union { float __f; int __i; } __u = { __f: __x };
return __u.__i < 0;
# else
@@ -50,7 +48,7 @@ __NTH (__signbitf (float __x))
__MATH_INLINE int
__NTH (__signbit (double __x))
{
-# if __WORDSIZE == 32
+# ifndef __x86_64__
__extension__ union { double __d; int __i[2]; } __u = { __d: __x };
return __u.__i[1] < 0;
# else
@@ -94,7 +92,7 @@ __NTH (lrint (double __x))
return __res;
}
# endif
-# if __WORDSIZE == 64
+# ifdef __x86_64__
__MATH_INLINE long long int
__NTH (llrintf (float __x))
{
diff --git a/libc/sysdeps/x86_64/fpu/e_powl.S b/libc/sysdeps/x86_64/fpu/e_powl.S
index bd6d82802..562791d30 100644
--- a/libc/sysdeps/x86_64/fpu/e_powl.S
+++ b/libc/sysdeps/x86_64/fpu/e_powl.S
@@ -32,6 +32,9 @@ limit: .double 0.29
ASM_TYPE_DIRECTIVE(p63,@object)
p63: .byte 0, 0, 0, 0, 0, 0, 0xe0, 0x43
ASM_SIZE_DIRECTIVE(p63)
+ ASM_TYPE_DIRECTIVE(p64,@object)
+p64: .byte 0, 0, 0, 0, 0, 0, 0xf0, 0x43
+ ASM_SIZE_DIRECTIVE(p64)
.section .rodata.cst16,"aM",@progbits,16
@@ -227,6 +230,19 @@ ENTRY(__ieee754_powl)
testb $2, %dh
jz 16f // jump if x == +inf
+ // fistpll raises invalid exception for |y| >= 1L<<63, but y
+ // may be odd unless we know |y| >= 1L<<64.
+ fldl MO(p64) // 1L<<64 : y
+ fld %st(1) // y : 1L<<64 : y
+ fabs // |y| : 1L<<64 : y
+ fcomip %st(1), %st // 1L<<64 : y
+ fstp %st(0) // y
+ jnc 16f
+ fldl MO(p63) // p63 : y
+ fxch // y : p63
+ fprem // y%p63 : p63
+ fstp %st(1) // y%p63
+
// We must find out whether y is an odd integer.
fld %st // y : y
fistpll -8(%rsp) // y
@@ -284,6 +300,19 @@ ENTRY(__ieee754_powl)
testb $2, %dh
jz 25f
+ // fistpll raises invalid exception for |y| >= 1L<<63, but y
+ // may be odd unless we know |y| >= 1L<<64.
+ fldl MO(p64) // 1L<<64 : y
+ fld %st(1) // y : 1L<<64 : y
+ fabs // |y| : 1L<<64 : y
+ fcomip %st(1), %st // 1L<<64 : y
+ fstp %st(0) // y
+ jnc 25f
+ fldl MO(p63) // p63 : y
+ fxch // y : p63
+ fprem // y%p63 : p63
+ fstp %st(1) // y%p63
+
fld %st // y : y
fistpll -8(%rsp) // y
fildll -8(%rsp) // int(y) : y
@@ -315,6 +344,18 @@ ENTRY(__ieee754_powl)
21: testb $2, %dh
jz 22f
+ // fistpll raises invalid exception for |y| >= 1L<<63, but y
+ // may be odd unless we know |y| >= 1L<<64.
+ fldl MO(p64) // 1L<<64 : y
+ fxch // y : 1L<<64
+ fcomi %st(1), %st // y : 1L<<64
+ fstp %st(1) // y
+ jnc 22f
+ fldl MO(p63) // p63 : y
+ fxch // y : p63
+ fprem // y%p63 : p63
+ fstp %st(1) // y%p63
+
fld %st // y : y
fistpll -8(%rsp) // y
fildll -8(%rsp) // int(y) : y
diff --git a/libc/sysdeps/x86_64/fpu/e_rem_pio2l.c b/libc/sysdeps/x86_64/fpu/e_rem_pio2l.c
deleted file mode 100644
index 1347b0468..000000000
--- a/libc/sysdeps/x86_64/fpu/e_rem_pio2l.c
+++ /dev/null
@@ -1,3 +0,0 @@
-/* Empty. This file is only meant to avoid compiling the file with the
- same name in the libm-ieee754 directory. The code is not used since
- there is an assembler version for all users of this file. */
diff --git a/libc/sysdeps/x86_64/fpu/feholdexcpt.c b/libc/sysdeps/x86_64/fpu/feholdexcpt.c
index b547b3495..b38047915 100644
--- a/libc/sysdeps/x86_64/fpu/feholdexcpt.c
+++ b/libc/sysdeps/x86_64/fpu/feholdexcpt.c
@@ -1,5 +1,5 @@
/* Store current floating-point environment and clear exceptions.
- Copyright (C) 2001, 2005, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2001-2012 Free Software 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,20 +22,13 @@ int
feholdexcept (fenv_t *envp)
{
unsigned int mxcsr;
- fenv_t temp;
- /* Store the environment. */
- __asm__ ("fnstenv %0\n"
- "stmxcsr %1" : "=m" (temp), "=m" (temp.__mxcsr));
- *envp = temp;
-
- /* Now set all exceptions to non-stop, first the x87 FPU. */
- temp.__control_word |= 0x3f;
-
- /* And clear all exceptions. */
- temp.__status_word &= ~0x3f;
-
- __asm__ ("fldenv %0" : : "m" (temp));
+ /* Store the environment. Recall that fnstenv has a side effect of
+ masking all exceptions. Then clear all exceptions. */
+ __asm__ ("fnstenv %0\n\t"
+ "stmxcsr %1\n\t"
+ "fnclex"
+ : "=m" (*envp), "=m" (envp->__mxcsr));
/* Set the SSE MXCSR register. */
mxcsr = (envp->__mxcsr | 0x1f80) & ~0x3f;
diff --git a/libc/sysdeps/x86_64/fpu/k_cosl.c b/libc/sysdeps/x86_64/fpu/k_cosl.c
deleted file mode 100644
index eea55a98d..000000000
--- a/libc/sysdeps/x86_64/fpu/k_cosl.c
+++ /dev/null
@@ -1 +0,0 @@
-/* Not needed. */
diff --git a/libc/sysdeps/x86_64/fpu/k_sinl.c b/libc/sysdeps/x86_64/fpu/k_sinl.c
deleted file mode 100644
index eea55a98d..000000000
--- a/libc/sysdeps/x86_64/fpu/k_sinl.c
+++ /dev/null
@@ -1 +0,0 @@
-/* Not needed. */
diff --git a/libc/sysdeps/x86_64/fpu/k_tanl.c b/libc/sysdeps/x86_64/fpu/k_tanl.c
deleted file mode 100644
index eea55a98d..000000000
--- a/libc/sysdeps/x86_64/fpu/k_tanl.c
+++ /dev/null
@@ -1 +0,0 @@
-/* Not needed. */
diff --git a/libc/sysdeps/x86_64/fpu/libm-test-ulps b/libc/sysdeps/x86_64/fpu/libm-test-ulps
index 867e8dd41..e5eb8f937 100644
--- a/libc/sysdeps/x86_64/fpu/libm-test-ulps
+++ b/libc/sysdeps/x86_64/fpu/libm-test-ulps
@@ -482,6 +482,9 @@ float: 1
ifloat: 1
# cexp
+Test "Real part of: cexp (-10000 + 0x1p16383 i) == 1.045876464564882298442774542991176546722e-4343 + 4.421154026488516836023811173959413420548e-4344 i":
+ildouble: 1
+ldouble: 1
Test "Imaginary part of: cexp (-2.0 - 3.0 i) == -0.13398091492954261346140525546115575 - 0.019098516261135196432576240858800925 i":
float: 1
ifloat: 1
@@ -491,6 +494,19 @@ ifloat: 1
Test "Imaginary part of: cexp (0.75 + 1.25 i) == 0.667537446429131586942201977015932112 + 2.00900045494094876258347228145863909 i":
ildouble: 1
ldouble: 1
+Test "Real part of: cexp (50 + 0x1p127 i) == 4.053997150228616856622417636046265337193e21 + 3.232070315463388524466674772633810238819e21 i":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+Test "Imaginary part of: cexp (50 + 0x1p127 i) == 4.053997150228616856622417636046265337193e21 + 3.232070315463388524466674772633810238819e21 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: cexp (500 + 0x1p1023 i) == -1.159886268932754433233243794561351783426e217 + 7.904017694554466595359379965081774849708e216 i":
+double: 1
+idouble: 1
# clog
Test "Imaginary part of: clog (-2 - 3 i) == 1.2824746787307683680267437207826593 - 2.1587989303424641704769327722648368 i":
@@ -501,6 +517,23 @@ float: 1
ifloat: 1
ildouble: 1
ldouble: 1
+Test "Real part of: clog (0x1.fffffep+127 + 0x1.fffffep+127 i) == 89.06941264234832570836679262104313101776 + pi/4 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog (0x1.fp+16383 + 0x1p+16383 i) == 11356.60974243783798653123798337822335902 + 0.4764674194737066993385333770295162295856 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog (0x1p-1074 + 0x1p-1074 i) == -744.0934983311012896593986823853525458290 + pi/4 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog (0x1p-147 + 0x1p-147 i) == -101.5460619520319878296245057936228672231 + pi/4 i":
+float: 1
+ifloat: 1
+Test "Real part of: clog (0x1p-149 + 0x1p-149 i) == -102.9323563131518784484589700365392203592 + pi/4 i":
+ildouble: 1
+ldouble: 1
# clog10
Test "Imaginary part of: clog10 (-0 + inf i) == inf + pi/2*log10(e) i":
@@ -570,6 +603,54 @@ idouble: 1
ifloat: 1
ildouble: 1
ldouble: 1
+Test "Real part of: clog10 (0x1.fffffep+127 + 0x1.fffffep+127 i) == 38.68235441693561449174780668781319348761 + pi/4*log10(e) i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (0x1.fffffep+127 + 0x1.fffffep+127 i) == 38.68235441693561449174780668781319348761 + pi/4*log10(e) i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Real part of: clog10 (0x1.fffffep+127 + 1.0 i) == 38.53183941910362389414093724045094697423 + 1.276276851248440096917018665609900318458e-39 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: clog10 (0x1.fffffffffffffp+1023 + 0x1.fffffffffffffp+1023 i) == 308.4052305577487344482591243175787477115 + pi/4*log10(e) i":
+double: 1
+idouble: 1
+Test "Real part of: clog10 (0x1.fffffffffffffp+1023 + 0x1p+1023 i) == 308.3031705664207720674749211936626341569 + 0.2013595981366865903254995612594728746470 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog10 (0x1.fp+16383 + 0x1.fp+16383 i) == 4932.212175672014259683102930239951947672 + pi/4*log10(e) i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (0x1p-1073 + 0x1p-1073 i) == -322.8546703496198318667349645920187712089 + pi/4*log10(e) i":
+double: 1
+idouble: 1
+Test "Real part of: clog10 (0x1p-1074 + 0x1p-1074 i) == -323.1557003452838130619487034867432642357 + pi/4*log10(e) i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (0x1p-1074 + 0x1p-1074 i) == -323.1557003452838130619487034867432642357 + pi/4*log10(e) i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (0x1p-147 + 0x1p-147 i) == -44.10089436477324509881274807713822842154 + pi/4*log10(e) i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Real part of: clog10 (0x1p-149 + 0x1p-149 i) == -44.70295435610120748924022586658721447508 + pi/4*log10(e) i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (0x1p-149 + 0x1p-149 i) == -44.70295435610120748924022586658721447508 + pi/4*log10(e) i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Real part of: clog10 (0x1p-16440 + 0x1p-16441 i) == -4948.884673709346821106688037612752099609 + 0.2013595981366865710389502301937289472543 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (0x1p-16440 + 0x1p-16441 i) == -4948.884673709346821106688037612752099609 + 0.2013595981366865710389502301937289472543 i":
+ildouble: 1
+ldouble: 1
Test "Imaginary part of: clog10 (3 + inf i) == inf + pi/2*log10(e) i":
double: 1
float: 1
@@ -621,12 +702,19 @@ float: 1
ifloat: 1
ildouble: 1
ldouble: 1
+Test "cos_downward (10) == -0.8390715290764524522588639478240648345199":
+ildouble: 1
+ldouble: 1
Test "cos_downward (2) == -0.4161468365471423869975682295007621897660":
float: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
Test "cos_downward (3) == -0.9899924966004454572715727947312613023937":
float: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
Test "cos_downward (4) == -0.6536436208636119146391681830977503814241":
float: 1
ifloat: 1
@@ -688,6 +776,8 @@ ldouble: 1
Test "cos_towardzero (8) == -0.1455000338086135258688413818311946826093":
float: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
# cos_upward
Test "cos_upward (10) == -0.8390715290764524522588639478240648345199":
@@ -701,6 +791,9 @@ ldouble: 1
Test "cos_upward (3) == -0.9899924966004454572715727947312613023937":
ildouble: 1
ldouble: 1
+Test "cos_upward (4) == -0.6536436208636119146391681830977503814241":
+ildouble: 1
+ldouble: 1
Test "cos_upward (5) == 0.2836621854632262644666391715135573083344":
ildouble: 1
ldouble: 1
@@ -712,9 +805,14 @@ ldouble: 1
Test "cos_upward (7) == 0.7539022543433046381411975217191820122183":
float: 1
ifloat: 1
+Test "cos_upward (8) == -0.1455000338086135258688413818311946826093":
+ildouble: 1
+ldouble: 1
Test "cos_upward (9) == -0.9111302618846769883682947111811653112463":
float: 2
ifloat: 2
+ildouble: 1
+ldouble: 1
# cosh_downward
Test "cosh_downward (22) == 1792456423.065795780980053377632656584997":
@@ -799,6 +897,8 @@ double: 1
float: 5
idouble: 1
ifloat: 5
+ildouble: 1
+ldouble: 1
Test "Imaginary part of: cpow (2 + 3 i, 4 + 0 i) == -119.0 - 120.0 i":
float: 2
ifloat: 2
@@ -848,6 +948,35 @@ ifloat: 1
Test "Real part of: csqrt (-2 - 3 i) == 0.89597747612983812471573375529004348 - 1.6741492280355400404480393008490519 i":
float: 1
ifloat: 1
+Test "Imaginary part of: csqrt (0x1.fffffep+127 + 1.0 i) == 1.844674352395372953599975585936590505260e+19 + 2.710505511993121390769065968615872097053e-20 i":
+float: 1
+ifloat: 1
+Test "Real part of: csqrt (0x1.fffffffffffffp+1023 + 0x1.fffffffffffffp+1023 i) == 1.473094556905565378990473658199034571917e+154 + 6.101757441282702188537080005372547713595e+153 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: csqrt (0x1.fffffffffffffp+1023 + 0x1.fffffffffffffp+1023 i) == 1.473094556905565378990473658199034571917e+154 + 6.101757441282702188537080005372547713595e+153 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: csqrt (0x1.fffffffffffffp+1023 + 0x1p+1023 i) == 1.379778091031440685006200821918878702861e+154 + 3.257214233483129514781233066898042490248e+153 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: csqrt (0x1.fp+16383 + 0x1.fp+16383 i) == 1.179514222452201722651836720466795901016e+2466 + 4.885707879516577666702435054303191575148e+2465 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: csqrt (0x1p-1073 + 0x1p-1073 i) == 3.453664695497464982856905711457966660085e-162 + 1.430554756764195530630723976279903095110e-162 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: csqrt (0x1p-1074 + 0x1p-1074 i) == 2.442109726130830256743814843868934877597e-162 + 1.011554969366634726113090867589031782487e-162 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: csqrt (0x1p-147 + 0x1p-147 i) == 8.225610928685557596194006925540350401606e-23 + 3.407159605465907500737319471202779419102e-23 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: csqrt (0x1p-149 + 0x1p-149 i) == 4.112805464342778798097003462770175200803e-23 + 1.703579802732953750368659735601389709551e-23 i":
+ildouble: 1
+ldouble: 1
# ctan
Test "Real part of: ctan (-2 - 3 i) == 0.376402564150424829275122113032269084e-2 - 1.00323862735360980144635859782192726 i":
@@ -1025,16 +1154,22 @@ float: 1
ifloat: 1
# j0
+Test "j0 (-0x1.001000001p+593) == -3.927269966354206207832593635798954916263e-90":
+ildouble: 2
+ldouble: 2
Test "j0 (-4.0) == -3.9714980986384737228659076845169804197562E-1":
double: 1
float: 1
idouble: 1
ifloat: 1
-ildouble: 1
-ldouble: 1
+ildouble: 2
+ldouble: 2
Test "j0 (0.75) == 0.864242275166648623555731103820923211":
float: 1
ifloat: 1
+Test "j0 (0x1.d7ce3ap+107) == 2.775523647291230802651040996274861694514e-17":
+float: 2
+ifloat: 2
Test "j0 (10.0) == -0.245935764451348335197760862485328754":
double: 2
float: 1
@@ -1048,8 +1183,8 @@ double: 1
float: 1
idouble: 1
ifloat: 1
-ildouble: 1
-ldouble: 1
+ildouble: 2
+ldouble: 2
Test "j0 (8.0) == 0.171650807137553906090869407851972001":
double: 2
float: 1
@@ -1057,6 +1192,14 @@ idouble: 2
ifloat: 1
# j1
+Test "j1 (0x1.3ffp+74) == 1.818984347516051243459364437186082741567e-12":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "j1 (0x1.ff00000000002p+840) == 1.846591691699331493194965158699937660696e-127":
+double: 1
+idouble: 1
Test "j1 (10.0) == 0.0434727461688614366697487680258592883":
float: 2
ifloat: 2
@@ -1077,8 +1220,8 @@ double: 1
float: 1
idouble: 1
ifloat: 1
-ildouble: 1
-ldouble: 1
+ildouble: 2
+ldouble: 2
Test "jn (0, 0.75) == 0.864242275166648623555731103820923211":
float: 1
ifloat: 1
@@ -1095,8 +1238,8 @@ double: 1
float: 1
idouble: 1
ifloat: 1
-ildouble: 1
-ldouble: 1
+ildouble: 2
+ldouble: 2
Test "jn (0, 8.0) == 0.171650807137553906090869407851972001":
double: 2
float: 1
@@ -1147,6 +1290,13 @@ idouble: 1
ifloat: 4
ildouble: 1
ldouble: 1
+Test "jn (2, 0x1.ffff62p+99) == -4.43860668048170034334926693188979974489e-16":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+ildouble: 1
+ldouble: 1
Test "jn (2, 2.4048255576957729) == 0.43175480701968038399746111312430703":
double: 2
float: 1
@@ -1380,14 +1530,25 @@ ldouble: 1
Test "sin_upward (1) == 0.8414709848078965066525023216302989996226":
float: 1
ifloat: 1
+Test "sin_upward (10) == -0.5440211108893698134047476618513772816836":
+ildouble: 1
+ldouble: 1
Test "sin_upward (2) == 0.9092974268256816953960198659117448427023":
float: 2
ifloat: 2
ildouble: 1
ldouble: 1
+Test "sin_upward (3) == 0.1411200080598672221007448028081102798469":
+ildouble: 1
+ldouble: 1
Test "sin_upward (4) == -0.7568024953079282513726390945118290941359":
float: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "sin_upward (5) == -0.9589242746631384688931544061559939733525":
+ildouble: 1
+ldouble: 1
Test "sin_upward (6) == -0.2794154981989258728115554466118947596280":
ildouble: 1
ldouble: 1
@@ -1480,6 +1641,12 @@ ildouble: 7
ldouble: 7
# tan
+Test "tan (0x1p16383) == 0.422722393732022337800504160054440141575":
+ildouble: 1
+ldouble: 1
+Test "tan (1e22) == -1.628778225606898878549375936939548513545":
+ildouble: 1
+ldouble: 1
Test "tan (pi/4) == 1":
double: 1
idouble: 1
@@ -1488,12 +1655,19 @@ idouble: 1
Test "tan_downward (1) == 1.5574077246549022305069748074583601730873":
float: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
Test "tan_downward (10) == 0.6483608274590866712591249330098086768169":
float: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
Test "tan_downward (2) == -2.1850398632615189916433061023136825434320":
float: 1
ifloat: 1
+Test "tan_downward (3) == -0.1425465430742778052956354105339134932261":
+ildouble: 1
+ldouble: 1
Test "tan_downward (4) == 1.1578212823495775831373424182673239231198":
ildouble: 1
ldouble: 1
@@ -1513,6 +1687,12 @@ float: 1
ifloat: 1
# tan_tonearest
+Test "tan_tonearest (1) == 1.5574077246549022305069748074583601730873":
+ildouble: 1
+ldouble: 1
+Test "tan_tonearest (2) == -2.1850398632615189916433061023136825434320":
+ildouble: 1
+ldouble: 1
Test "tan_tonearest (6) == -0.2910061913847491570536995888681755428312":
ildouble: 1
ldouble: 1
@@ -1524,9 +1704,14 @@ ildouble: 1
ldouble: 1
# tan_towardzero
+Test "tan_towardzero (1) == 1.5574077246549022305069748074583601730873":
+ildouble: 1
+ldouble: 1
Test "tan_towardzero (10) == 0.6483608274590866712591249330098086768169":
float: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
Test "tan_towardzero (2) == -2.1850398632615189916433061023136825434320":
ildouble: 1
ldouble: 1
@@ -1577,6 +1762,8 @@ ldouble: 1
Test "tan_upward (5) == -3.3805150062465856369827058794473439087096":
float: 1
ifloat: 1
+ildouble: 2
+ldouble: 2
Test "tan_upward (6) == -0.2910061913847491570536995888681755428312":
ildouble: 1
ldouble: 1
@@ -1614,6 +1801,14 @@ ldouble: 1
Test "y0 (0.125) == -1.38968062514384052915582277745018693":
ildouble: 1
ldouble: 1
+Test "y0 (0x1.3ffp+74) == 1.818984347516051243459467456433028748678e-12":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "y0 (0x1.ff00000000002p+840) == 1.846591691699331493194965158699937660696e-127":
+double: 1
+idouble: 1
Test "y0 (1.0) == 0.0882569642156769579829267660235151628":
double: 2
float: 1
@@ -1645,6 +1840,14 @@ double: 1
idouble: 1
ildouble: 1
ldouble: 1
+Test "y1 (0x1.001000001p+593) == 3.927269966354206207832593635798954916263e-90":
+ildouble: 2
+ldouble: 2
+Test "y1 (0x1.27e204p+99) == -8.881610148467797208469612080785210013461e-16":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
Test "y1 (1.5) == -0.412308626973911295952829820633445323":
float: 1
ifloat: 1
@@ -1903,17 +2106,25 @@ ildouble: 1
ldouble: 1
Function: Real part of "cexp":
+double: 2
float: 1
+idouble: 2
ifloat: 1
+ildouble: 1
+ldouble: 1
Function: Imaginary part of "cexp":
+double: 1
float: 1
+idouble: 1
ifloat: 1
ildouble: 1
ldouble: 1
Function: Real part of "clog":
+double: 1
float: 1
+idouble: 1
ifloat: 1
ildouble: 1
ldouble: 1
@@ -2033,8 +2244,18 @@ ildouble: 2
ldouble: 2
Function: Real part of "csqrt":
+double: 1
float: 1
+idouble: 1
+ifloat: 1
+
+Function: Imaginary part of "csqrt":
+double: 1
+float: 1
+idouble: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
Function: Real part of "ctan":
double: 1
@@ -2123,8 +2344,8 @@ double: 2
float: 2
idouble: 2
ifloat: 2
-ildouble: 1
-ldouble: 1
+ildouble: 2
+ldouble: 2
Function: "j1":
double: 1
@@ -2239,6 +2460,8 @@ ldouble: 27
Function: "tan":
double: 1
idouble: 1
+ildouble: 1
+ldouble: 1
Function: "tan_downward":
float: 1
@@ -2283,8 +2506,8 @@ double: 3
float: 2
idouble: 3
ifloat: 2
-ildouble: 1
-ldouble: 1
+ildouble: 2
+ldouble: 2
Function: "yn":
double: 3
diff --git a/libc/sysdeps/x86_64/fpu/math_private.h b/libc/sysdeps/x86_64/fpu/math_private.h
index c8616f654..63a699e8f 100644
--- a/libc/sysdeps/x86_64/fpu/math_private.h
+++ b/libc/sysdeps/x86_64/fpu/math_private.h
@@ -1,56 +1,32 @@
#ifndef X86_64_MATH_PRIVATE_H
#define X86_64_MATH_PRIVATE_H 1
-#define math_opt_barrier(x) \
- ({ __typeof(x) __x; \
- if (sizeof (x) <= sizeof (double)) \
- __asm ("" : "=x" (__x) : "0" (x)); \
- else \
- __asm ("" : "=t" (__x) : "0" (x)); \
- __x; })
-#define math_force_eval(x) \
- do { \
- if (sizeof (x) <= sizeof (double)) \
- __asm __volatile ("" : : "x" (x)); \
- else \
- __asm __volatile ("" : : "f" (x)); \
- } while (0)
-
-#include_next <math_private.h>
-
/* We can do a few things better on x86-64. */
#if defined __AVX__ || defined SSE2AVX
# define MOVD "vmovd"
-# define STMXCSR "vstmxcsr"
-# define LDMXCSR "vldmxcsr"
#else
# define MOVD "movd"
-# define STMXCSR "stmxcsr"
-# define LDMXCSR "ldmxcsr"
#endif
/* Direct movement of float into integer register. */
-#undef EXTRACT_WORDS64
#define EXTRACT_WORDS64(i, d) \
do { \
- long int i_; \
+ int64_t i_; \
asm (MOVD " %1, %0" : "=rm" (i_) : "x" ((double) (d))); \
(i) = i_; \
} while (0)
/* And the reverse. */
-#undef INSERT_WORDS64
#define INSERT_WORDS64(d, i) \
do { \
- long int i_ = i; \
+ int64_t i_ = i; \
double d__; \
asm (MOVD " %1, %0" : "=x" (d__) : "rm" (i_)); \
d = d__; \
} while (0)
/* Direct movement of float into integer register. */
-#undef GET_FLOAT_WORD
#define GET_FLOAT_WORD(i, d) \
do { \
int i_; \
@@ -59,7 +35,6 @@
} while (0)
/* And the reverse. */
-#undef SET_FLOAT_WORD
#define SET_FLOAT_WORD(f, i) \
do { \
int i_ = i; \
@@ -68,27 +43,8 @@
f = f__; \
} while (0)
-
-#define __isnan(d) \
- ({ long int __di; EXTRACT_WORDS64 (__di, (double) (d)); \
- (__di & 0x7fffffffffffffffl) > 0x7ff0000000000000l; })
-#define __isnanf(d) \
- ({ int __di; GET_FLOAT_WORD (__di, (float) d); \
- (__di & 0x7fffffff) > 0x7f800000; })
-
-#define __isinf_ns(d) \
- ({ long int __di; EXTRACT_WORDS64 (__di, (double) (d)); \
- (__di & 0x7fffffffffffffffl) == 0x7ff0000000000000l; })
-#define __isinf_nsf(d) \
- ({ int __di; GET_FLOAT_WORD (__di, (float) d); \
- (__di & 0x7fffffff) == 0x7f800000; })
-
-#define __finite(d) \
- ({ long int __di; EXTRACT_WORDS64 (__di, (double) (d)); \
- (__di & 0x7fffffffffffffffl) < 0x7ff0000000000000l; })
-#define __finitef(d) \
- ({ int __di; GET_FLOAT_WORD (__di, (float) d); \
- (__di & 0x7fffffff) < 0x7f800000; })
+#include <sysdeps/i386/fpu/fenv_private.h>
+#include_next <math_private.h>
extern __always_inline double
__ieee754_sqrt (double d)
@@ -172,61 +128,4 @@ __floorf (float d)
}
#endif /* __SSE4_1__ */
-
-/* Specialized variants of the <fenv.h> interfaces which only handle
- either the FPU or the SSE unit. */
-#undef libc_feholdexcept
-#define libc_feholdexcept(e) \
- do { \
- unsigned int mxcsr; \
- asm (STMXCSR " %0" : "=m" (*&mxcsr)); \
- (e)->__mxcsr = mxcsr; \
- mxcsr = (mxcsr | 0x1f80) & ~0x3f; \
- asm volatile (LDMXCSR " %0" : : "m" (*&mxcsr)); \
- } while (0)
-#undef libc_feholdexceptf
-#define libc_feholdexceptf(e) libc_feholdexcept (e)
-// #define libc_feholdexceptl(e) (void) feholdexcept (e)
-
-#undef libc_feholdexcept_setround
-#define libc_feholdexcept_setround(e, r) \
- do { \
- unsigned int mxcsr; \
- asm (STMXCSR " %0" : "=m" (*&mxcsr)); \
- (e)->__mxcsr = mxcsr; \
- mxcsr = ((mxcsr | 0x1f80) & ~0x603f) | ((r) << 3); \
- asm volatile (LDMXCSR " %0" : : "m" (*&mxcsr)); \
- } while (0)
-#undef libc_feholdexcept_setroundf
-#define libc_feholdexcept_setroundf(e, r) libc_feholdexcept_setround (e, r)
-// #define libc_feholdexcept_setroundl(e, r) ...
-
-#undef libc_fetestexcept
-#define libc_fetestexcept(e) \
- ({ unsigned int mxcsr; \
- asm volatile (STMXCSR " %0" : "=m" (*&mxcsr)); \
- mxcsr & (e) & FE_ALL_EXCEPT; })
-#undef libc_fetestexceptf
-#define libc_fetestexceptf(e) libc_fetestexcept (e)
-// #define libc_fetestexceptl(e) fetestexcept (e)
-
-#undef libc_fesetenv
-#define libc_fesetenv(e) \
- asm volatile (LDMXCSR " %0" : : "m" ((e)->__mxcsr))
-#undef libc_fesetenvf
-#define libc_fesetenvf(e) libc_fesetenv (e)
-// #define libc_fesetenvl(e) (void) fesetenv (e)
-
-#undef libc_feupdateenv
-#define libc_feupdateenv(e) \
- do { \
- unsigned int mxcsr; \
- asm volatile (STMXCSR " %0" : "=m" (*&mxcsr)); \
- asm volatile (LDMXCSR " %0" : : "m" ((e)->__mxcsr)); \
- __feraiseexcept (mxcsr & FE_ALL_EXCEPT); \
- } while (0)
-#undef libc_feupdateenvf
-#define libc_feupdateenvf(e) libc_feupdateenv (e)
-// #define libc_feupdateenvl(e) (void) feupdateenv (e)
-
#endif /* X86_64_MATH_PRIVATE_H */
diff --git a/libc/sysdeps/x86_64/fpu/s_cosl.S b/libc/sysdeps/x86_64/fpu/s_cosl.S
deleted file mode 100644
index 6921cda56..000000000
--- a/libc/sysdeps/x86_64/fpu/s_cosl.S
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Written by J.T. Conklin <jtc@netbsd.org>.
- * Public domain.
- *
- * Adapted for `long double' by Ulrich Drepper <drepper@cygnus.com>.
- * Adapted for x86-64 by Andreas Jaeger <aj@suse.de>.
- * Fixed errno handling by Ulrich Drepper <drepper@redhat.com>.
- */
-
-#define __need_Emath
-#include <bits/errno.h>
-#include <machine/asm.h>
-
-ENTRY(__cosl)
- fldt 8(%rsp)
- fxam
- fstsw %ax
- movb $0x45, %dh
- andb %ah, %dh
- cmpb $0x05, %dh
- je 3f
-4: fcos
- fnstsw %ax
- testl $0x400,%eax
- jnz 1f
- ret
- .align ALIGNARG(4)
-1: fldpi
- fadd %st(0)
- fxch %st(1)
-2: fprem1
- fnstsw %ax
- testl $0x400,%eax
- jnz 2b
- fstp %st(1)
- fcos
- ret
-3: call __errno_location@PLT
- movl $EDOM, (%rax)
- jmp 4b
-END (__cosl)
-weak_alias (__cosl, cosl)
diff --git a/libc/sysdeps/x86_64/fpu/s_sincos.S b/libc/sysdeps/x86_64/fpu/s_sincos.S
deleted file mode 100644
index 3bc9d71f5..000000000
--- a/libc/sysdeps/x86_64/fpu/s_sincos.S
+++ /dev/null
@@ -1,60 +0,0 @@
-/* Compute sine and cosine of argument.
- Copyright (C) 1997, 2000, 2001, 2005 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <machine/asm.h>
-#include "bp-sym.h"
-#include "bp-asm.h"
-
-#define PARMS LINKAGE /* no space for saved regs */
-#define ANGLE PARMS
-#define SINP ANGLE+12
-#define COSP SINP+PTR_SIZE
-
- .text
-ENTRY (BP_SYM (__sincos))
- ENTER
-
- movsd %xmm0, -8(%rsp)
- fldl -8(%rsp)
- fsincos
- fnstsw %ax
- testl $0x400,%eax
- jnz 1f
- fstpl (%rsi)
- fstpl (%rdi)
-
- LEAVE
- retq
-
-1: fldpi
- fadd %st(0)
- fxch %st(1)
-2: fprem1
- fnstsw %ax
- testl $0x400,%eax
- jnz 2b
- fstp %st(1)
- fsincos
- fstpl (%rsi)
- fstpl (%rdi)
-
- LEAVE
- retq
-END (BP_SYM (__sincos))
-weak_alias (BP_SYM (__sincos), BP_SYM (sincos))
diff --git a/libc/sysdeps/x86_64/fpu/s_sinl.S b/libc/sysdeps/x86_64/fpu/s_sinl.S
deleted file mode 100644
index 79fc4af95..000000000
--- a/libc/sysdeps/x86_64/fpu/s_sinl.S
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Written by J.T. Conklin <jtc@netbsd.org>.
- * Public domain.
- *
- * Adapted for `long double' by Ulrich Drepper <drepper@cygnus.com>.
- * Adapted for x86-64 by Andreas Jaeger <aj@suse.de>.
- * Fixed errno handling by Ulrich Drepper <drepper@redhat.com>.
- */
-
-#define __need_Emath
-#include <bits/errno.h>
-#include <machine/asm.h>
-
-ENTRY(__sinl)
- fldt 8(%rsp)
- fxam
- fstsw %ax
- movb $0x45, %dh
- andb %ah, %dh
- cmpb $0x05, %dh
- je 3f
-4: fsin
- fnstsw %ax
- testl $0x400,%eax
- jnz 1f
- ret
- .align ALIGNARG(4)
-1: fldpi
- fadd %st(0)
- fxch %st(1)
-2: fprem1
- fnstsw %ax
- testl $0x400,%eax
- jnz 2b
- fstp %st(1)
- fsin
- ret
-3: call __errno_location@PLT
- movl $EDOM, (%rax)
- jmp 4b
-END (__sinl)
-weak_alias (__sinl, sinl)
diff --git a/libc/sysdeps/x86_64/fpu/s_tanl.S b/libc/sysdeps/x86_64/fpu/s_tanl.S
deleted file mode 100644
index 6427e3f6f..000000000
--- a/libc/sysdeps/x86_64/fpu/s_tanl.S
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Written by J.T. Conklin <jtc@netbsd.org>.
- * Public domain.
- *
- * Adapted for `long double' by Ulrich Drepper <drepper@cygnus.com>.
- * Adapted for x86-64 by Andreas Jaeger <aj@suse.de>.
- * Fixed errno handling by Ulrich Drepper <drepper@redhat.com>.
- */
-
-#define __need_Emath
-#include <bits/errno.h>
-#include <machine/asm.h>
-
-RCSID("$NetBSD: $")
-
-ENTRY(__tanl)
- fldt 8(%rsp)
- fxam
- fstsw %ax
- movb $0x45, %dh
- andb %ah, %dh
- cmpb $0x05, %dh
- je 3f
-4: fptan
- fnstsw %ax
- testl $0x400,%eax
- jnz 1f
- fstp %st(0)
- ret
-1: fldpi
- fadd %st(0)
- fxch %st(1)
-2: fprem1
- fstsw %ax
- testl $0x400,%eax
- jnz 2b
- fstp %st(1)
- fptan
- fstp %st(0)
- ret
-3: call __errno_location@PLT
- movl $EDOM, (%rax)
- jmp 4b
-END (__tanl)
-weak_alias (__tanl, tanl)
diff --git a/libc/sysdeps/x86_64/jmpbuf-unwind.h b/libc/sysdeps/x86_64/jmpbuf-unwind.h
index 646615d43..890037ea7 100644
--- a/libc/sysdeps/x86_64/jmpbuf-unwind.h
+++ b/libc/sysdeps/x86_64/jmpbuf-unwind.h
@@ -28,7 +28,9 @@
((void *) (address) < (void *) demangle ((jmpbuf)[JB_RSP]))
#define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \
- _JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj)
+ _JMPBUF_UNWINDS_ADJ (_jmpbuf, \
+ (void *) (_Unwind_Ptr) _Unwind_GetCFA (_context), \
+ _adj)
static inline uintptr_t __attribute__ ((unused))
_jmpbuf_sp (__jmp_buf regs)
diff --git a/libc/time/offtime.c b/libc/time/offtime.c
index 1ccd6a89e..56c49f020 100644
--- a/libc/time/offtime.c
+++ b/libc/time/offtime.c
@@ -31,7 +31,7 @@ __offtime (t, offset, tp)
long int offset;
struct tm *tp;
{
- long int days, rem, y;
+ time_t days, rem, y;
const unsigned short int *ip;
days = *t / SECS_PER_DAY;
@@ -63,7 +63,7 @@ __offtime (t, offset, tp)
while (days < 0 || days >= (__isleap (y) ? 366 : 365))
{
/* Guess a corrected year, assuming 365 days per year. */
- long int yg = y + days / 365 - (days % 365 < 0);
+ time_t yg = y + days / 365 - (days % 365 < 0);
/* Adjust DAYS and Y to match the guessed year. */
days -= ((yg - y) * 365
diff --git a/libc/timezone/Makefile b/libc/timezone/Makefile
index 484e60ad6..e7370d3d9 100644
--- a/libc/timezone/Makefile
+++ b/libc/timezone/Makefile
@@ -45,7 +45,6 @@ include ../Makeconfig # Get objpfx defined so we can use it below.
CPPFLAGS-zic = -DNOT_IN_libc
ifeq ($(have-ksh),yes)
-install-others += $(inst_zonedir)/iso3166.tab $(inst_zonedir)/zone.tab
install-bin-script = tzselect
generated += tzselect
endif
@@ -133,7 +132,3 @@ $(objpfx)tzselect: tzselect.ksh $(common-objpfx)config.make
-e 's%@REPORT_BUGS_TO@%$(REPORT_BUGS_TO)%g' < $< > $@.new
chmod 555 $@.new
mv -f $@.new $@
-
-$(addprefix $(inst_zonedir)/,iso3166.tab zone.tab): \
- $(inst_zonedir)/%: % $(+force)
- $(do-install)
diff --git a/ports/ChangeLog.alpha b/ports/ChangeLog.alpha
index f34c3c4a9..500e2273c 100644
--- a/ports/ChangeLog.alpha
+++ b/ports/ChangeLog.alpha
@@ -1,3 +1,17 @@
+2012-03-21 Richard Henderson <rth@twiddle.net>
+
+ * sysdeps/alpha/hp-timing.h: Include <_itoa.h> instead
+ of <stdio-common/_itoa.h>.
+
+2012-03-19 Richard Henderson <rth@twiddle.net>
+
+ * sysdeps/alpha/fpu/math_private.h: New file.
+
+2012-03-11 Richard Henderson <rth@twiddle.net>
+
+ * sysdeps/unix/sysv/linux/alpha/bits/socket.h: Remove file.
+ * sysdeps/unix/sysv/linux/alpha/bits/socket_type.h: New file.
+
2012-03-09 Paul Eggert <eggert@cs.ucla.edu>
[BZ #13673]
diff --git a/ports/ChangeLog.arm b/ports/ChangeLog.arm
index ba2cb2347..f1376cdab 100644
--- a/ports/ChangeLog.arm
+++ b/ports/ChangeLog.arm
@@ -1,3 +1,8 @@
+2012-03-20 Joseph Myers <joseph@codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/arm/register-dump.h: Include <_itoa.h>
+ instead of <stdio-common/_itoa.h>.
+
2012-03-09 Paul Eggert <eggert@cs.ucla.edu>
[BZ #13673]
diff --git a/ports/ChangeLog.m68k b/ports/ChangeLog.m68k
index 70559a50a..04c4f93a1 100644
--- a/ports/ChangeLog.m68k
+++ b/ports/ChangeLog.m68k
@@ -1,3 +1,23 @@
+2012-03-21 Andreas Schwab <schwab@linux-m68k.org>
+
+ * sysdeps/unix/sysv/linux/m68k/register-dump.h: Include <_itoa.h>
+ instead of <stdio-common/_itoa.h>.
+
+2012-03-20 Andreas Schwab <schwab@linux-m68k.org>
+
+ * sysdeps/m68k/m680x0/fpu/libm-test-ulps: Update.
+
+2012-03-15 Andreas Schwab <schwab@linux-m68k.org>
+
+ * sysdeps/m68k/m680x0/fpu/libm-test-ulps: Update.
+
+2012-03-13 Andreas Schwab <schwab@linux-m68k.org>
+
+ * sysdeps/unix/sysv/linux/m68k/kernel-features.h
+ (__ASSUME_NEW_GETRLIMIT_SYSCALL, __ASSUME_VFORK_SYSCALL): Define
+ for 2.4.12 or later.
+ (__ASSUME_PSELECT, __ASSUME_PPOLL): Only undefine before 3.0.
+
2012-03-09 Richard Henderson <rth@twiddle.net>
* sysdeps/m68k/m680x0/fpu/math_private.h: Use include_next to
diff --git a/ports/ChangeLog.mips b/ports/ChangeLog.mips
index 8eef3c8fe..44667cdea 100644
--- a/ports/ChangeLog.mips
+++ b/ports/ChangeLog.mips
@@ -1,3 +1,14 @@
+2012-03-20 Joseph Myers <joseph@codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/mips/register-dump.h: Include <_itoa.h>
+ instead of <stdio-common/_itoa.h>.
+
+2012-03-10 Paul Eggert <eggert@cs.ucla.edu>
+
+ [BZ #13673]
+ * sysdeps/mips/mips64/gmp-mparam.h: Replace FSF snail mail address
+ with URL.
+
2012-03-09 Paul Eggert <eggert@cs.ucla.edu>
[BZ #13673]
diff --git a/ports/sysdeps/alpha/fpu/math_private.h b/ports/sysdeps/alpha/fpu/math_private.h
new file mode 100644
index 000000000..eb2177d78
--- /dev/null
+++ b/ports/sysdeps/alpha/fpu/math_private.h
@@ -0,0 +1,21 @@
+#ifndef ALPHA_MATH_PRIVATE_H
+#define ALPHA_MATH_PRIVATE_H 1
+
+/* In bits/mathinline.h we define __isnan et al.
+ In sysdeps/alpha/fpu/s_isnan.c we move the identifier out of the way
+ via macro hackery. In both cases, tell math/math_private.h that
+ we have a local copy of the function. */
+
+#ifndef __isnan
+# define __isnan __isnan
+#endif
+#ifndef __isnanf
+# define __isnanf __isnanf
+#endif
+#ifndef __isnanl
+# define __isnanl __isnanl
+#endif
+
+#include_next <math_private.h>
+
+#endif /* ALPHA_MATH_PRIVATE_H */
diff --git a/ports/sysdeps/alpha/hp-timing.h b/ports/sysdeps/alpha/hp-timing.h
index aea743deb..399d71635 100644
--- a/ports/sysdeps/alpha/hp-timing.h
+++ b/ports/sysdeps/alpha/hp-timing.h
@@ -22,7 +22,7 @@
#include <string.h>
#include <sys/param.h>
-#include <stdio-common/_itoa.h>
+#include <_itoa.h>
/* The macros defined here use the timestamp counter in IA-64. They
provide a very accurate way to measure the time with very little
diff --git a/ports/sysdeps/m68k/m680x0/fpu/libm-test-ulps b/ports/sysdeps/m68k/m680x0/fpu/libm-test-ulps
index 8fa326d1b..8d6478cfe 100644
--- a/ports/sysdeps/m68k/m680x0/fpu/libm-test-ulps
+++ b/ports/sysdeps/m68k/m680x0/fpu/libm-test-ulps
@@ -24,6 +24,76 @@ ildouble: 1
ldouble: 1
# cacos
+Test "Imaginary part of: cacos (+0 + 0.5 i) == pi/2 - 0.4812118250596034474977589134243684231352 i":
+double: 2
+idouble: 2
+Test "Imaginary part of: cacos (+0 + 1.0 i) == pi/2 - 0.8813735870195430252326093249797923090282 i":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 2
+ldouble: 2
+Test "Imaginary part of: cacos (+0 + 1.5 i) == pi/2 - 1.194763217287109304111930828519090523536 i":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+Test "Imaginary part of: cacos (+0 - 0.5 i) == pi/2 + 0.4812118250596034474977589134243684231352 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: cacos (+0 - 1.0 i) == pi/2 + 0.8813735870195430252326093249797923090282 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Imaginary part of: cacos (+0 - 1.5 i) == pi/2 + 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: cacos (-0 + 0.5 i) == pi/2 - 0.4812118250596034474977589134243684231352 i":
+double: 2
+idouble: 2
+Test "Imaginary part of: cacos (-0 + 1.0 i) == pi/2 - 0.8813735870195430252326093249797923090282 i":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 2
+ldouble: 2
+Test "Imaginary part of: cacos (-0 + 1.5 i) == pi/2 - 1.194763217287109304111930828519090523536 i":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+Test "Imaginary part of: cacos (-0 - 0.5 i) == pi/2 + 0.4812118250596034474977589134243684231352 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: cacos (-0 - 1.0 i) == pi/2 + 0.8813735870195430252326093249797923090282 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Imaginary part of: cacos (-0 - 1.5 i) == pi/2 + 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: cacos (-1.5 + +0 i) == pi - 0.9624236501192068949955178268487368462704 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Imaginary part of: cacos (-1.5 - 0 i) == pi + 0.9624236501192068949955178268487368462704 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: cacos (0.5 + +0 i) == 1.047197551196597746154214461093167628066 - 0 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: cacos (0.5 - 0 i) == 1.047197551196597746154214461093167628066 + +0 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
Test "Real part of: cacos (0.75 + 1.25 i) == 1.11752014915610270578240049553777969 - 1.13239363160530819522266333696834467 i":
float: 2
ifloat: 2
@@ -34,8 +104,76 @@ float: 1
ifloat: 1
ildouble: 2
ldouble: 2
+Test "Imaginary part of: cacos (1.5 + +0 i) == +0 - 0.9624236501192068949955178268487368462704 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Imaginary part of: cacos (1.5 - 0 i) == +0 + 0.9624236501192068949955178268487368462704 i":
+ildouble: 1
+ldouble: 1
# cacosh
+Test "Real part of: cacosh (+0 + 0.5 i) == 0.4812118250596034474977589134243684231352 + pi/2 i":
+float: 1
+ifloat: 1
+Test "Real part of: cacosh (+0 + 1.0 i) == 0.8813735870195430252326093249797923090282 + pi/2 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Real part of: cacosh (+0 + 1.5 i) == 1.194763217287109304111930828519090523536 + pi/2 i":
+double: 1
+idouble: 1
+Test "Real part of: cacosh (+0 - 0.5 i) == 0.4812118250596034474977589134243684231352 - pi/2 i":
+float: 1
+ifloat: 1
+Test "Real part of: cacosh (+0 - 1.0 i) == 0.8813735870195430252326093249797923090282 - pi/2 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Real part of: cacosh (+0 - 1.5 i) == 1.194763217287109304111930828519090523536 - pi/2 i":
+double: 1
+idouble: 1
+Test "Real part of: cacosh (-0 + 0.5 i) == 0.4812118250596034474977589134243684231352 + pi/2 i":
+float: 1
+ifloat: 1
+Test "Real part of: cacosh (-0 + 1.0 i) == 0.8813735870195430252326093249797923090282 + pi/2 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Real part of: cacosh (-0 + 1.5 i) == 1.194763217287109304111930828519090523536 + pi/2 i":
+double: 1
+idouble: 1
+Test "Real part of: cacosh (-0 - 0.5 i) == 0.4812118250596034474977589134243684231352 - pi/2 i":
+float: 1
+ifloat: 1
+Test "Real part of: cacosh (-0 - 1.0 i) == 0.8813735870195430252326093249797923090282 - pi/2 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Real part of: cacosh (-0 - 1.5 i) == 1.194763217287109304111930828519090523536 - pi/2 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: cacosh (-0.5 + +0 i) == +0 + 2.094395102393195492308428922186335256131 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cacosh (-0.5 - 0 i) == +0 - 2.094395102393195492308428922186335256131 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: cacosh (-1.5 + +0 i) == 0.9624236501192068949955178268487368462704 + pi i":
+float: 1
+ifloat: 1
+Test "Real part of: cacosh (-1.5 - 0 i) == 0.9624236501192068949955178268487368462704 - pi i":
+float: 1
+ifloat: 1
Test "Real part of: cacosh (-2 - 3 i) == 1.9833870299165354323470769028940395 - 2.1414491111159960199416055713254211 i":
double: 1
float: 7
@@ -54,8 +192,74 @@ ldouble: 1
Test "Imaginary part of: cacosh (0.75 + 1.25 i) == 1.13239363160530819522266333696834467 + 1.11752014915610270578240049553777969 i":
float: 1
ifloat: 1
+Test "Real part of: cacosh (1.5 + +0 i) == 0.9624236501192068949955178268487368462704 + +0 i":
+float: 1
+ifloat: 1
+Test "Real part of: cacosh (1.5 - 0 i) == 0.9624236501192068949955178268487368462704 - 0 i":
+float: 1
+ifloat: 1
# casin
+Test "Imaginary part of: casin (+0 + 0.5 i) == +0 + 0.4812118250596034474977589134243684231352 i":
+double: 2
+idouble: 2
+Test "Imaginary part of: casin (+0 + 1.0 i) == +0 + 0.8813735870195430252326093249797923090282 i":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 2
+ldouble: 2
+Test "Imaginary part of: casin (+0 + 1.5 i) == +0 + 1.194763217287109304111930828519090523536 i":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+Test "Imaginary part of: casin (+0 - 0.5 i) == +0 - 0.4812118250596034474977589134243684231352 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: casin (+0 - 1.0 i) == +0 - 0.8813735870195430252326093249797923090282 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Imaginary part of: casin (+0 - 1.5 i) == +0 - 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: casin (-0 + 0.5 i) == -0 + 0.4812118250596034474977589134243684231352 i":
+double: 2
+idouble: 2
+Test "Imaginary part of: casin (-0 + 1.0 i) == -0 + 0.8813735870195430252326093249797923090282 i":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 2
+ldouble: 2
+Test "Imaginary part of: casin (-0 + 1.5 i) == -0 + 1.194763217287109304111930828519090523536 i":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+Test "Imaginary part of: casin (-0 - 0.5 i) == -0 - 0.4812118250596034474977589134243684231352 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: casin (-0 - 1.0 i) == -0 - 0.8813735870195430252326093249797923090282 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Imaginary part of: casin (-0 - 1.5 i) == -0 - 1.194763217287109304111930828519090523536 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: casin (-1.5 + +0 i) == -pi/2 + 0.9624236501192068949955178268487368462704 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Imaginary part of: casin (-1.5 - 0 i) == -pi/2 - 0.9624236501192068949955178268487368462704 i":
+ildouble: 1
+ldouble: 1
Test "Real part of: casin (0.75 + 1.25 i) == 0.453276177638793913448921196101971749 + 1.13239363160530819522266333696834467 i":
double: 1
float: 5
@@ -68,8 +272,62 @@ float: 1
ifloat: 1
ildouble: 2
ldouble: 2
+Test "Imaginary part of: casin (1.5 + +0 i) == pi/2 + 0.9624236501192068949955178268487368462704 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Imaginary part of: casin (1.5 - 0 i) == pi/2 - 0.9624236501192068949955178268487368462704 i":
+ildouble: 1
+ldouble: 1
# casinh
+Test "Real part of: casinh (+0 + 1.5 i) == 0.9624236501192068949955178268487368462704 + pi/2 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: casinh (+0 - 1.5 i) == 0.9624236501192068949955178268487368462704 - pi/2 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: casinh (-0 + 1.5 i) == -0.9624236501192068949955178268487368462704 + pi/2 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Real part of: casinh (-0 - 1.5 i) == -0.9624236501192068949955178268487368462704 - pi/2 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Real part of: casinh (-0.5 + +0 i) == -0.4812118250596034474977589134243684231352 + +0 i":
+double: 2
+idouble: 2
+Test "Real part of: casinh (-0.5 - 0 i) == -0.4812118250596034474977589134243684231352 - 0 i":
+double: 2
+idouble: 2
+Test "Real part of: casinh (-1.0 + +0 i) == -0.8813735870195430252326093249797923090282 + +0 i":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 2
+ldouble: 2
+Test "Real part of: casinh (-1.0 - 0 i) == -0.8813735870195430252326093249797923090282 - 0 i":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 2
+ldouble: 2
+Test "Real part of: casinh (-1.5 + +0 i) == -1.194763217287109304111930828519090523536 + +0 i":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+Test "Real part of: casinh (-1.5 - 0 i) == -1.194763217287109304111930828519090523536 - 0 i":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
Test "Real part of: casinh (-2 - 3 i) == -1.9686379257930962917886650952454982 - 0.96465850440760279204541105949953237 i":
double: 6
float: 19
@@ -84,6 +342,12 @@ idouble: 13
ifloat: 6
ildouble: 6
ldouble: 6
+Test "Real part of: casinh (0.5 + +0 i) == 0.4812118250596034474977589134243684231352 + +0 i":
+float: 1
+ifloat: 1
+Test "Real part of: casinh (0.5 - 0 i) == 0.4812118250596034474977589134243684231352 - 0 i":
+float: 1
+ifloat: 1
Test "Real part of: casinh (0.75 + 1.25 i) == 1.03171853444778027336364058631006594 + 0.911738290968487636358489564316731207 i":
float: 1
ifloat: 1
@@ -96,6 +360,22 @@ idouble: 1
ifloat: 1
ildouble: 1
ldouble: 1
+Test "Real part of: casinh (1.0 + +0 i) == 0.8813735870195430252326093249797923090282 + +0 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Real part of: casinh (1.0 - 0 i) == 0.8813735870195430252326093249797923090282 - 0 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Real part of: casinh (1.5 + +0 i) == 1.194763217287109304111930828519090523536 + +0 i":
+double: 1
+idouble: 1
+Test "Real part of: casinh (1.5 - 0 i) == 1.194763217287109304111930828519090523536 - 0 i":
+double: 1
+idouble: 1
# catan
Test "Imaginary part of: catan (-2 - 3 i) == -1.4099210495965755225306193844604208 - 0.22907268296853876629588180294200276 i":
@@ -183,6 +463,12 @@ ldouble: 1
Test "Imaginary part of: clog (0.75 + 1.25 i) == 0.376885901188190075998919126749298416 + 1.03037682652431246378774332703115153 i":
ildouble: 1
ldouble: 1
+Test "Real part of: clog (0x1.fp+16383 + 0x1p+16383 i) == 11356.60974243783798653123798337822335902 + 0.4764674194737066993385333770295162295856 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog (0x1.fp+16383 + 0x1p+16383 i) == 11356.60974243783798653123798337822335902 + 0.4764674194737066993385333770295162295856 i":
+ildouble: 1
+ldouble: 1
# clog10
Test "Imaginary part of: clog10 (-0 + inf i) == inf + pi/2*log10(e) i":
@@ -233,6 +519,9 @@ double: 1
idouble: 1
ildouble: 2
ldouble: 2
+Test "Imaginary part of: clog10 (0x1p-16440 + 0x1p-16441 i) == -4948.884673709346821106688037612752099609 + 0.2013595981366865710389502301937289472543 i":
+ildouble: 1
+ldouble: 1
Test "Imaginary part of: clog10 (3 + inf i) == inf + pi/2*log10(e) i":
float: 1
ifloat: 1
@@ -533,6 +822,32 @@ Test "Imaginary part of: csinh (0.75 + 1.25 i) == 0.2592948545511627791533498306
float: 1
ifloat: 1
+# csqrt
+Test "Real part of: csqrt (0x1.fffffffffffffp+1023 + 0x1.fffffffffffffp+1023 i) == 1.473094556905565378990473658199034571917e+154 + 6.101757441282702188537080005372547713595e+153 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: csqrt (0x1.fffffffffffffp+1023 + 0x1.fffffffffffffp+1023 i) == 1.473094556905565378990473658199034571917e+154 + 6.101757441282702188537080005372547713595e+153 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: csqrt (0x1.fffffffffffffp+1023 + 0x1p+1023 i) == 1.379778091031440685006200821918878702861e+154 + 3.257214233483129514781233066898042490248e+153 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: csqrt (0x1.fp+16383 + 0x1.fp+16383 i) == 1.179514222452201722651836720466795901016e+2466 + 4.885707879516577666702435054303191575148e+2465 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: csqrt (0x1p-1073 + 0x1p-1073 i) == 3.453664695497464982856905711457966660085e-162 + 1.430554756764195530630723976279903095110e-162 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: csqrt (0x1p-1074 + 0x1p-1074 i) == 2.442109726130830256743814843868934877597e-162 + 1.011554969366634726113090867589031782487e-162 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: csqrt (0x1p-147 + 0x1p-147 i) == 8.225610928685557596194006925540350401606e-23 + 3.407159605465907500737319471202779419102e-23 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: csqrt (0x1p-149 + 0x1p-149 i) == 4.112805464342778798097003462770175200803e-23 + 1.703579802732953750368659735601389709551e-23 i":
+ildouble: 1
+ldouble: 1
+
# ctan
Test "Real part of: ctan (-2 - 3 i) == 0.376402564150424829275122113032269084e-2 - 1.00323862735360980144635859782192726 i":
double: 1
@@ -682,6 +997,9 @@ float: 1
ifloat: 1
# j0
+Test "j0 (-0x1.001000001p+593) == -3.927269966354206207832593635798954916263e-90":
+ildouble: 2
+ldouble: 2
Test "j0 (-4.0) == -3.9714980986384737228659076845169804197562E-1":
float: 1
ifloat: 1
@@ -690,6 +1008,9 @@ ldouble: 2
Test "j0 (0.75) == 0.864242275166648623555731103820923211":
float: 1
ifloat: 1
+Test "j0 (0x1.d7ce3ap+107) == 2.775523647291230802651040996274861694514e-17":
+float: 2
+ifloat: 2
Test "j0 (1.5) == 0.511827671735918128749051744283411720":
float: 1
ifloat: 1
@@ -709,6 +1030,11 @@ ifloat: 1
Test "j1 (-1.0) == -0.440050585744933515959682203718914913":
float: 1
ifloat: 1
+Test "j1 (0x1.3ffp+74) == 1.818984347516051243459364437186082741567e-12":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
Test "j1 (1.0) == 0.440050585744933515959682203718914913":
float: 1
ifloat: 1
@@ -806,6 +1132,11 @@ float: 2
ifloat: 2
ildouble: 1
ldouble: 1
+Test "jn (2, 0x1.ffff62p+99) == -4.43860668048170034334926693188979974489e-16":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
Test "jn (2, 2.4048255576957729) == 0.43175480701968038399746111312430703":
float: 1
ifloat: 1
@@ -1337,6 +1668,11 @@ idouble: 1
ifloat: 1
ildouble: 2
ldouble: 2
+Test "y0 (0x1.3ffp+74) == 1.818984347516051243459467456433028748678e-12":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
Test "y0 (1.0) == 0.0882569642156769579829267660235151628":
ildouble: 1
ldouble: 1
@@ -1363,6 +1699,16 @@ ldouble: 1
Test "y1 (0.125) == -5.19993611253477499595928744876579921":
ildouble: 1
ldouble: 1
+Test "y1 (0x1.001000001p+593) == 3.927269966354206207832593635798954916263e-90":
+ildouble: 2
+ldouble: 2
+Test "y1 (0x1.27e204p+99) == -8.881610148467797208469612080785210013461e-16":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 1
+ldouble: 1
Test "y1 (1.0) == -0.781212821300288716547150000047964821":
double: 1
idouble: 1
@@ -1487,13 +1833,17 @@ ildouble: 1
ldouble: 1
Function: Real part of "cacos":
+double: 1
float: 2
+idouble: 1
ifloat: 2
ildouble: 1
ldouble: 1
Function: Imaginary part of "cacos":
+double: 2
float: 1
+idouble: 2
ifloat: 1
ildouble: 2
ldouble: 2
@@ -1523,7 +1873,9 @@ ildouble: 3
ldouble: 3
Function: Imaginary part of "casin":
+double: 2
float: 1
+idouble: 2
ifloat: 1
ildouble: 2
ldouble: 2
@@ -1712,6 +2064,16 @@ Function: Imaginary part of "csinh":
float: 1
ifloat: 1
+Function: Real part of "csqrt":
+double: 1
+idouble: 1
+
+Function: Imaginary part of "csqrt":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+
Function: Real part of "ctan":
double: 1
idouble: 1
@@ -1776,9 +2138,9 @@ ifloat: 1
Function: "j0":
double: 1
-float: 1
+float: 2
idouble: 1
-ifloat: 1
+ifloat: 2
ildouble: 2
ldouble: 2
@@ -1961,8 +2323,8 @@ double: 1
float: 2
idouble: 1
ifloat: 2
-ildouble: 1
-ldouble: 1
+ildouble: 2
+ldouble: 2
Function: "yn":
double: 1
diff --git a/ports/sysdeps/mips/mips64/gmp-mparam.h b/ports/sysdeps/mips/mips64/gmp-mparam.h
index 7666137a2..be2dcb89a 100644
--- a/ports/sysdeps/mips/mips64/gmp-mparam.h
+++ b/ports/sysdeps/mips/mips64/gmp-mparam.h
@@ -15,8 +15,7 @@ or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public License
-along with the GNU MP Library; see the file COPYING.LIB. If not, write to
-the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
+along with the GNU MP Library. If not, see <http://www.gnu.org/licenses/>. */
#if defined __GMP_H__ && ! defined _LONG_LONG_LIMB
#error "Included too late for _LONG_LONG_LIMB to take effect"
diff --git a/ports/sysdeps/unix/sysv/linux/alpha/bits/socket.h b/ports/sysdeps/unix/sysv/linux/alpha/bits/socket.h
deleted file mode 100644
index 8ae4edf29..000000000
--- a/ports/sysdeps/unix/sysv/linux/alpha/bits/socket.h
+++ /dev/null
@@ -1,437 +0,0 @@
-/* System-specific socket constants and types. Linux version.
- Copyright (C) 1991-2012 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received 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_SOCKET_H
-#define __BITS_SOCKET_H
-
-#ifndef _SYS_SOCKET_H
-# error "Never include <bits/socket.h> directly; use <sys/socket.h> instead."
-#endif
-
-#define __need_size_t
-#include <stddef.h>
-
-#include <sys/types.h>
-
-/* Type for length arguments in socket calls. */
-#ifndef __socklen_t_defined
-typedef __socklen_t socklen_t;
-# define __socklen_t_defined
-#endif
-
-/* Types of sockets. */
-enum __socket_type
-{
- SOCK_STREAM = 1, /* Sequenced, reliable, connection-based
- byte streams. */
-#define SOCK_STREAM SOCK_STREAM
- SOCK_DGRAM = 2, /* Connectionless, unreliable datagrams
- of fixed maximum length. */
-#define SOCK_DGRAM SOCK_DGRAM
- SOCK_RAW = 3, /* Raw protocol interface. */
-#define SOCK_RAW SOCK_RAW
- SOCK_RDM = 4, /* Reliably-delivered messages. */
-#define SOCK_RDM SOCK_RDM
- SOCK_SEQPACKET = 5, /* Sequenced, reliable, connection-based,
- datagrams of fixed maximum length. */
-#define SOCK_SEQPACKET SOCK_SEQPACKET
- SOCK_DCCP = 6, /* Datagram Congestion Control Protocol. */
-#define SOCK_DCCP SOCK_DCCP
- SOCK_PACKET = 10, /* Linux specific way of getting packets
- at the dev level. For writing rarp and
- other similar things on the user level. */
-#define SOCK_PACKET SOCK_PACKET
-
- /* Flags to be ORed into the type parameter of socket and socketpair and
- used for the flags parameter of paccept. */
-
- SOCK_CLOEXEC = 010000000, /* Atomically set close-on-exec flag for the
- new descriptor(s). */
-#define SOCK_CLOEXEC SOCK_CLOEXEC
- SOCK_NONBLOCK = 0x40000000 /* Atomically mark descriptor(s) as
- non-blocking. */
-#define SOCK_NONBLOCK SOCK_NONBLOCK
-};
-
-/* Protocol families. */
-#define PF_UNSPEC 0 /* Unspecified. */
-#define PF_LOCAL 1 /* Local to host (pipes and file-domain). */
-#define PF_UNIX PF_LOCAL /* POSIX name for PF_LOCAL. */
-#define PF_FILE PF_LOCAL /* Another non-standard name for PF_LOCAL. */
-#define PF_INET 2 /* IP protocol family. */
-#define PF_AX25 3 /* Amateur Radio AX.25. */
-#define PF_IPX 4 /* Novell Internet Protocol. */
-#define PF_APPLETALK 5 /* Appletalk DDP. */
-#define PF_NETROM 6 /* Amateur radio NetROM. */
-#define PF_BRIDGE 7 /* Multiprotocol bridge. */
-#define PF_ATMPVC 8 /* ATM PVCs. */
-#define PF_X25 9 /* Reserved for X.25 project. */
-#define PF_INET6 10 /* IP version 6. */
-#define PF_ROSE 11 /* Amateur Radio X.25 PLP. */
-#define PF_DECnet 12 /* Reserved for DECnet project. */
-#define PF_NETBEUI 13 /* Reserved for 802.2LLC project. */
-#define PF_SECURITY 14 /* Security callback pseudo AF. */
-#define PF_KEY 15 /* PF_KEY key management API. */
-#define PF_NETLINK 16
-#define PF_ROUTE PF_NETLINK /* Alias to emulate 4.4BSD. */
-#define PF_PACKET 17 /* Packet family. */
-#define PF_ASH 18 /* Ash. */
-#define PF_ECONET 19 /* Acorn Econet. */
-#define PF_ATMSVC 20 /* ATM SVCs. */
-#define PF_RDS 21 /* RDS sockets. */
-#define PF_SNA 22 /* Linux SNA Project */
-#define PF_IRDA 23 /* IRDA sockets. */
-#define PF_PPPOX 24 /* PPPoX sockets. */
-#define PF_WANPIPE 25 /* Wanpipe API sockets. */
-#define PF_LLC 26 /* Linux LLC. */
-#define PF_CAN 29 /* Controller Area Network. */
-#define PF_TIPC 30 /* TIPC sockets. */
-#define PF_BLUETOOTH 31 /* Bluetooth sockets. */
-#define PF_IUCV 32 /* IUCV sockets. */
-#define PF_RXRPC 33 /* RxRPC sockets. */
-#define PF_ISDN 34 /* mISDN sockets. */
-#define PF_PHONET 35 /* Phonet sockets. */
-#define PF_IEEE802154 36 /* IEEE 802.15.4 sockets. */
-#define PF_MAX 37 /* For now.. */
-
-/* Address families. */
-#define AF_UNSPEC PF_UNSPEC
-#define AF_LOCAL PF_LOCAL
-#define AF_UNIX PF_UNIX
-#define AF_FILE PF_FILE
-#define AF_INET PF_INET
-#define AF_AX25 PF_AX25
-#define AF_IPX PF_IPX
-#define AF_APPLETALK PF_APPLETALK
-#define AF_NETROM PF_NETROM
-#define AF_BRIDGE PF_BRIDGE
-#define AF_ATMPVC PF_ATMPVC
-#define AF_X25 PF_X25
-#define AF_INET6 PF_INET6
-#define AF_ROSE PF_ROSE
-#define AF_DECnet PF_DECnet
-#define AF_NETBEUI PF_NETBEUI
-#define AF_SECURITY PF_SECURITY
-#define AF_KEY PF_KEY
-#define AF_NETLINK PF_NETLINK
-#define AF_ROUTE PF_ROUTE
-#define AF_PACKET PF_PACKET
-#define AF_ASH PF_ASH
-#define AF_ECONET PF_ECONET
-#define AF_ATMSVC PF_ATMSVC
-#define AF_RDS PF_RDS
-#define AF_SNA PF_SNA
-#define AF_IRDA PF_IRDA
-#define AF_PPPOX PF_PPPOX
-#define AF_WANPIPE PF_WANPIPE
-#define AF_LLC PF_LLC
-#define AF_CAN PF_CAN
-#define AF_TIPC PF_TIPC
-#define AF_BLUETOOTH PF_BLUETOOTH
-#define AF_IUCV PF_IUCV
-#define AF_RXRPC PF_RXRPC
-#define AF_ISDN PF_ISDN
-#define AF_PHONET PF_PHONET
-#define AF_IEEE802154 PF_IEEE802154
-#define AF_MAX PF_MAX
-
-/* Socket level values. Others are defined in the appropriate headers.
-
- XXX These definitions also should go into the appropriate headers as
- far as they are available. */
-#define SOL_RAW 255
-#define SOL_DECNET 261
-#define SOL_X25 262
-#define SOL_PACKET 263
-#define SOL_ATM 264 /* ATM layer (cell level). */
-#define SOL_AAL 265 /* ATM Adaption Layer (packet level). */
-#define SOL_IRDA 266
-
-/* Maximum queue length specifiable by listen. */
-#define SOMAXCONN 128
-
-/* Get the definition of the macro to define the common sockaddr members. */
-#include <bits/sockaddr.h>
-
-/* Structure describing a generic socket address. */
-struct sockaddr
- {
- __SOCKADDR_COMMON (sa_); /* Common data: address family and length. */
- char sa_data[14]; /* Address data. */
- };
-
-
-/* Structure large enough to hold any socket address (with the historical
- exception of AF_UNIX). We reserve 128 bytes. */
-#define __ss_aligntype unsigned long int
-#define _SS_SIZE 128
-#define _SS_PADSIZE (_SS_SIZE - (2 * sizeof (__ss_aligntype)))
-
-struct sockaddr_storage
- {
- __SOCKADDR_COMMON (ss_); /* Address family, etc. */
- __ss_aligntype __ss_align; /* Force desired alignment. */
- char __ss_padding[_SS_PADSIZE];
- };
-
-
-/* Bits in the FLAGS argument to `send', `recv', et al. */
-enum
- {
- MSG_OOB = 0x01, /* Process out-of-band data. */
-#define MSG_OOB MSG_OOB
- MSG_PEEK = 0x02, /* Peek at incoming messages. */
-#define MSG_PEEK MSG_PEEK
- MSG_DONTROUTE = 0x04, /* Don't use local routing. */
-#define MSG_DONTROUTE MSG_DONTROUTE
-#ifdef __USE_GNU
- /* DECnet uses a different name. */
- MSG_TRYHARD = MSG_DONTROUTE,
-# define MSG_TRYHARD MSG_DONTROUTE
-#endif
- MSG_CTRUNC = 0x08, /* Control data lost before delivery. */
-#define MSG_CTRUNC MSG_CTRUNC
- MSG_PROXY = 0x10, /* Supply or ask second address. */
-#define MSG_PROXY MSG_PROXY
- MSG_TRUNC = 0x20,
-#define MSG_TRUNC MSG_TRUNC
- MSG_DONTWAIT = 0x40, /* Nonblocking IO. */
-#define MSG_DONTWAIT MSG_DONTWAIT
- MSG_EOR = 0x80, /* End of record. */
-#define MSG_EOR MSG_EOR
- MSG_WAITALL = 0x100, /* Wait for a full request. */
-#define MSG_WAITALL MSG_WAITALL
- MSG_FIN = 0x200,
-#define MSG_FIN MSG_FIN
- MSG_SYN = 0x400,
-#define MSG_SYN MSG_SYN
- MSG_CONFIRM = 0x800, /* Confirm path validity. */
-#define MSG_CONFIRM MSG_CONFIRM
- MSG_RST = 0x1000,
-#define MSG_RST MSG_RST
- MSG_ERRQUEUE = 0x2000, /* Fetch message from error queue. */
-#define MSG_ERRQUEUE MSG_ERRQUEUE
- MSG_NOSIGNAL = 0x4000, /* Do not generate SIGPIPE. */
-#define MSG_NOSIGNAL MSG_NOSIGNAL
- MSG_MORE = 0x8000, /* Sender will send more. */
-#define MSG_MORE MSG_MORE
- MSG_WAITFORONE = 0x10000, /* Wait for at least one packet to return.*/
-#define MSG_WAITFORONE MSG_WAITFORONE
-
- MSG_CMSG_CLOEXEC = 0x40000000 /* Set close_on_exit for file
- descriptor received through
- SCM_RIGHTS. */
-#define MSG_CMSG_CLOEXEC MSG_CMSG_CLOEXEC
- };
-
-
-/* Structure describing messages sent by
- `sendmsg' and received by `recvmsg'. */
-struct msghdr
- {
- void *msg_name; /* Address to send to/receive from. */
- socklen_t msg_namelen; /* Length of address data. */
-
- struct iovec *msg_iov; /* Vector of data to send/receive into. */
- size_t msg_iovlen; /* Number of elements in the vector. */
-
- void *msg_control; /* Ancillary data (eg BSD filedesc passing). */
- size_t msg_controllen; /* Ancillary data buffer length.
- !! The type should be socklen_t but the
- definition of the kernel is incompatible
- with this. */
-
- int msg_flags; /* Flags on received message. */
- };
-
-#ifdef __USE_GNU
-/* For `recvmmsg'. */
-struct mmsghdr
- {
- struct msghdr msg_hdr; /* Actual message header. */
- unsigned int msg_len; /* Number of received bytes for the entry. */
- };
-#endif
-
-/* Structure used for storage of ancillary data object information. */
-struct cmsghdr
- {
- size_t cmsg_len; /* Length of data in cmsg_data plus length
- of cmsghdr structure.
- !! The type should be socklen_t but the
- definition of the kernel is incompatible
- with this. */
- int cmsg_level; /* Originating protocol. */
- int cmsg_type; /* Protocol specific type. */
-#if (!defined __STRICT_ANSI__ && __GNUC__ >= 2) || __STDC_VERSION__ >= 199901L
- __extension__ unsigned char __cmsg_data __flexarr; /* Ancillary data. */
-#endif
- };
-
-/* Ancillary data object manipulation macros. */
-#if (!defined __STRICT_ANSI__ && __GNUC__ >= 2) || __STDC_VERSION__ >= 199901L
-# define CMSG_DATA(cmsg) ((cmsg)->__cmsg_data)
-#else
-# define CMSG_DATA(cmsg) ((unsigned char *) ((struct cmsghdr *) (cmsg) + 1))
-#endif
-#define CMSG_NXTHDR(mhdr, cmsg) __cmsg_nxthdr (mhdr, cmsg)
-#define CMSG_FIRSTHDR(mhdr) \
- ((size_t) (mhdr)->msg_controllen >= sizeof (struct cmsghdr) \
- ? (struct cmsghdr *) (mhdr)->msg_control : (struct cmsghdr *) 0)
-#define CMSG_ALIGN(len) (((len) + sizeof (size_t) - 1) \
- & (size_t) ~(sizeof (size_t) - 1))
-#define CMSG_SPACE(len) (CMSG_ALIGN (len) \
- + CMSG_ALIGN (sizeof (struct cmsghdr)))
-#define CMSG_LEN(len) (CMSG_ALIGN (sizeof (struct cmsghdr)) + (len))
-
-extern struct cmsghdr *__cmsg_nxthdr (struct msghdr *__mhdr,
- struct cmsghdr *__cmsg) __THROW;
-#ifdef __USE_EXTERN_INLINES
-# ifndef _EXTERN_INLINE
-# define _EXTERN_INLINE __extern_inline
-# endif
-_EXTERN_INLINE struct cmsghdr *
-__NTH (__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg))
-{
- if ((size_t) __cmsg->cmsg_len < sizeof (struct cmsghdr))
- /* The kernel header does this so there may be a reason. */
- return 0;
-
- __cmsg = (struct cmsghdr *) ((unsigned char *) __cmsg
- + CMSG_ALIGN (__cmsg->cmsg_len));
- if ((unsigned char *) (__cmsg + 1) > ((unsigned char *) __mhdr->msg_control
- + __mhdr->msg_controllen)
- || ((unsigned char *) __cmsg + CMSG_ALIGN (__cmsg->cmsg_len)
- > ((unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen)))
- /* No more entries. */
- return 0;
- return __cmsg;
-}
-#endif /* Use `extern inline'. */
-
-/* Socket level message types. This must match the definitions in
- <linux/socket.h>. */
-enum
- {
- SCM_RIGHTS = 0x01 /* Transfer file descriptors. */
-#define SCM_RIGHTS SCM_RIGHTS
-#ifdef __USE_GNU
- , SCM_CREDENTIALS = 0x02 /* Credentials passing. */
-# define SCM_CREDENTIALS SCM_CREDENTIALS
-#endif
- };
-
-#ifdef __USE_GNU
-/* User visible structure for SCM_CREDENTIALS message */
-struct ucred
-{
- pid_t pid; /* PID of sending process. */
- uid_t uid; /* UID of sending process. */
- gid_t gid; /* GID of sending process. */
-};
-#endif
-
-/* Ugly workaround for unclean kernel headers. */
-#if !defined __USE_MISC && !defined __USE_GNU
-# ifndef FIOGETOWN
-# define __SYS_SOCKET_H_undef_FIOGETOWN
-# endif
-# ifndef FIOSETOWN
-# define __SYS_SOCKET_H_undef_FIOSETOWN
-# endif
-# ifndef SIOCATMARK
-# define __SYS_SOCKET_H_undef_SIOCATMARK
-# endif
-# ifndef SIOCGPGRP
-# define __SYS_SOCKET_H_undef_SIOCGPGRP
-# endif
-# ifndef SIOCGSTAMP
-# define __SYS_SOCKET_H_undef_SIOCGSTAMP
-# endif
-# ifndef SIOCGSTAMPNS
-# define __SYS_SOCKET_H_undef_SIOCGSTAMPNS
-# endif
-# ifndef SIOCSPGRP
-# define __SYS_SOCKET_H_undef_SIOCSPGRP
-# endif
-#endif
-
-/* Get socket manipulation related informations from kernel headers. */
-#include <asm/socket.h>
-
-#if !defined __USE_MISC && !defined __USE_GNU
-# ifdef __SYS_SOCKET_H_undef_FIOGETOWN
-# undef __SYS_SOCKET_H_undef_FIOGETOWN
-# undef FIOGETOWN
-# endif
-# ifdef __SYS_SOCKET_H_undef_FIOSETOWN
-# undef __SYS_SOCKET_H_undef_FIOSETOWN
-# undef FIOSETOWN
-# endif
-# ifdef __SYS_SOCKET_H_undef_SIOCATMARK
-# undef __SYS_SOCKET_H_undef_SIOCATMARK
-# undef SIOCATMARK
-# endif
-# ifdef __SYS_SOCKET_H_undef_SIOCGPGRP
-# undef __SYS_SOCKET_H_undef_SIOCGPGRP
-# undef SIOCGPGRP
-# endif
-# ifdef __SYS_SOCKET_H_undef_SIOCGSTAMP
-# undef __SYS_SOCKET_H_undef_SIOCGSTAMP
-# undef SIOCGSTAMP
-# endif
-# ifdef __SYS_SOCKET_H_undef_SIOCGSTAMPNS
-# undef __SYS_SOCKET_H_undef_SIOCGSTAMPNS
-# undef SIOCGSTAMPNS
-# endif
-# ifdef __SYS_SOCKET_H_undef_SIOCSPGRP
-# undef __SYS_SOCKET_H_undef_SIOCSPGRP
-# undef SIOCSPGRP
-# endif
-#endif
-
-/* Structure used to manipulate the SO_LINGER option. */
-struct linger
- {
- int l_onoff; /* Nonzero to linger on close. */
- int l_linger; /* Time to linger. */
- };
-
-
-__BEGIN_DECLS
-
-#ifdef __USE_GNU
-/* Receive up to VLEN messages as described by VMESSAGES from socket FD.
- Returns the number of bytes read or -1 for errors.
- This function is a cancellation point and therefore not marked with
- __THROW. */
-extern int recvmmsg (int __fd, struct mmsghdr *__vmessages,
- unsigned int __vlen, int __flags,
- const struct timespec *__tmo);
-
-/* Send a VLEN messages as described by VMESSAGES to socket FD.
- Return the number of datagrams successfully written or -1 for errors.
- This function is a cancellation point and therefore not marked with
- __THROW. */
-extern int sendmmsg (int __fd, struct mmsghdr *__vmessages,
- unsigned int __vlen, int __flags);
-#endif
-
-__END_DECLS
-
-#endif /* bits/socket.h */
diff --git a/ports/sysdeps/unix/sysv/linux/alpha/bits/socket_type.h b/ports/sysdeps/unix/sysv/linux/alpha/bits/socket_type.h
new file mode 100644
index 000000000..d3f45436b
--- /dev/null
+++ b/ports/sysdeps/unix/sysv/linux/alpha/bits/socket_type.h
@@ -0,0 +1,55 @@
+/* Define enum __socket_type for Linux/Alpha.
+ Copyright (C) 1991-2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _SYS_SOCKET_H
+# error "Never include <bits/socket_type.h> directly; use <sys/socket.h> instead."
+#endif
+
+/* Types of sockets. */
+enum __socket_type
+{
+ SOCK_STREAM = 1, /* Sequenced, reliable, connection-based
+ byte streams. */
+#define SOCK_STREAM SOCK_STREAM
+ SOCK_DGRAM = 2, /* Connectionless, unreliable datagrams
+ of fixed maximum length. */
+#define SOCK_DGRAM SOCK_DGRAM
+ SOCK_RAW = 3, /* Raw protocol interface. */
+#define SOCK_RAW SOCK_RAW
+ SOCK_RDM = 4, /* Reliably-delivered messages. */
+#define SOCK_RDM SOCK_RDM
+ SOCK_SEQPACKET = 5, /* Sequenced, reliable, connection-based,
+ datagrams of fixed maximum length. */
+#define SOCK_SEQPACKET SOCK_SEQPACKET
+ SOCK_DCCP = 6, /* Datagram Congestion Control Protocol. */
+#define SOCK_DCCP SOCK_DCCP
+ SOCK_PACKET = 10, /* Linux specific way of getting packets
+ at the dev level. For writing rarp and
+ other similar things on the user level. */
+#define SOCK_PACKET SOCK_PACKET
+
+ /* Flags to be ORed into the type parameter of socket and socketpair and
+ used for the flags parameter of paccept. */
+
+ SOCK_CLOEXEC = 010000000, /* Atomically set close-on-exec flag for the
+ new descriptor(s). */
+#define SOCK_CLOEXEC SOCK_CLOEXEC
+ SOCK_NONBLOCK = 0x40000000 /* Atomically mark descriptor(s) as
+ non-blocking. */
+#define SOCK_NONBLOCK SOCK_NONBLOCK
+};
diff --git a/ports/sysdeps/unix/sysv/linux/arm/register-dump.h b/ports/sysdeps/unix/sysv/linux/arm/register-dump.h
index 32c15eea6..3d72b8422 100644
--- a/ports/sysdeps/unix/sysv/linux/arm/register-dump.h
+++ b/ports/sysdeps/unix/sysv/linux/arm/register-dump.h
@@ -1,5 +1,5 @@
/* Dump registers.
- Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1998-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Philip Blundell <pb@nexus.co.uk>, 1998.
@@ -18,7 +18,7 @@
<http://www.gnu.org/licenses/>. */
#include <sys/uio.h>
-#include <stdio-common/_itoa.h>
+#include <_itoa.h>
#include <sys/ucontext.h>
/* We will print the register dump in this format:
diff --git a/ports/sysdeps/unix/sysv/linux/m68k/kernel-features.h b/ports/sysdeps/unix/sysv/linux/m68k/kernel-features.h
index 94dcb4450..07186b079 100644
--- a/ports/sysdeps/unix/sysv/linux/m68k/kernel-features.h
+++ b/ports/sysdeps/unix/sysv/linux/m68k/kernel-features.h
@@ -1,6 +1,6 @@
/* Set flags signalling availability of kernel features based on given
kernel version number.
- Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+ Copyright (C) 2008, 2009, 2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -24,6 +24,8 @@
# define __ASSUME_STAT64_SYSCALL 1
# define __ASSUME_FCNTL64 1
# define __ASSUME_VFORK_SYSCALL 1
+# define __ASSUME_NEW_GETRLIMIT_SYSCALL 1
+# define __ASSUME_VFORK_SYSCALL 1
#endif
/* Many syscalls were added in 2.6.10 for m68k. */
@@ -35,9 +37,11 @@
#include_next <kernel-features.h>
-/* These syscalls are not implemented yet for m68k. */
-#undef __ASSUME_PSELECT
-#undef __ASSUME_PPOLL
+/* These syscalls were added only in 3.0 for m68k. */
+#if __LINUX_KERNEL_VERSION < 0x030000
+# undef __ASSUME_PSELECT
+# undef __ASSUME_PPOLL
+#endif
#ifdef __mcoldfire__
/* ColdFire kernels have PAGE_SHIFT set to 13 and expect
diff --git a/ports/sysdeps/unix/sysv/linux/m68k/register-dump.h b/ports/sysdeps/unix/sysv/linux/m68k/register-dump.h
index 91a654bd5..877089ecb 100644
--- a/ports/sysdeps/unix/sysv/linux/m68k/register-dump.h
+++ b/ports/sysdeps/unix/sysv/linux/m68k/register-dump.h
@@ -1,5 +1,5 @@
/* Dump registers.
- Copyright (C) 1998, 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2002, 2004, 2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Schwab <schwab@gnu.org>.
@@ -19,7 +19,7 @@
#include <stddef.h>
#include <sys/uio.h>
-#include <stdio-common/_itoa.h>
+#include <_itoa.h>
/* We will print the register dump in this format:
diff --git a/ports/sysdeps/unix/sysv/linux/mips/register-dump.h b/ports/sysdeps/unix/sysv/linux/mips/register-dump.h
index ef986bd0a..186228119 100644
--- a/ports/sysdeps/unix/sysv/linux/mips/register-dump.h
+++ b/ports/sysdeps/unix/sysv/linux/mips/register-dump.h
@@ -1,5 +1,5 @@
/* Dump registers.
- Copyright (C) 2000, 2001, 2002, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2000-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@suse.de>, 2000.
@@ -18,7 +18,7 @@
<http://www.gnu.org/licenses/>. */
#include <sys/uio.h>
-#include <stdio-common/_itoa.h>
+#include <_itoa.h>
/* We will print the register dump in this format: