summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjoseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d>2012-12-02 21:11:45 +0000
committerjoseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d>2012-12-02 21:11:45 +0000
commit94c459cc7a611211d10773eef526826a8da80456 (patch)
tree68526f35a4f1d891b05436e0233a85c74dcc7eff
parent2b19f7c91f9f7c2a7c585cc62b5f3fe75bece1b7 (diff)
downloadeglibc2-94c459cc7a611211d10773eef526826a8da80456.tar.gz
Merge changes between r21775 and r21911 from /fsf/trunk.
git-svn-id: svn://svn.eglibc.org/trunk@21912 7b3dc134-2b1b-0410-93df-9e9f96275f8d
-rw-r--r--libc/ChangeLog570
-rw-r--r--libc/NEWS42
-rw-r--r--libc/aclocal.m428
-rw-r--r--libc/bits/byteswap.h11
-rwxr-xr-xlibc/configure159
-rw-r--r--libc/configure.in90
-rw-r--r--libc/conform/data/cpio.h-data2
-rw-r--r--libc/conform/data/errno.h-data39
-rw-r--r--libc/conform/data/fcntl.h-data22
-rw-r--r--libc/conform/data/glob.h-data2
-rw-r--r--libc/conform/data/limits.h-data153
-rw-r--r--libc/conform/data/locale.h-data2
-rw-r--r--libc/conform/data/mqueue.h-data8
-rw-r--r--libc/conform/data/regex.h-data1
-rw-r--r--libc/conform/data/signal.h-data8
-rw-r--r--libc/conform/data/stdio.h-data16
-rw-r--r--libc/conform/data/sys/stat.h-data2
-rw-r--r--libc/conform/data/sys/times.h-data2
-rw-r--r--libc/conform/data/time.h-data12
-rw-r--r--libc/conform/data/unistd.h-data10
-rw-r--r--libc/conform/data/wordexp.h-data1
-rw-r--r--libc/debug/test-strcpy_chk.c3
-rw-r--r--libc/elf/Makefile2
-rw-r--r--libc/elf/cache.c8
-rw-r--r--libc/elf/dl-load.c3
-rw-r--r--libc/elf/elf.h9
-rw-r--r--libc/elf/get-dynamic-info.h11
-rwxr-xr-xlibc/elf/sotruss.ksh4
-rw-r--r--libc/include/elf.h6
-rw-r--r--libc/include/libc-internal.h16
-rw-r--r--libc/include/rpc/svc.h2
-rw-r--r--libc/include/sys/socket.h4
-rw-r--r--libc/inet/tst-inet6_rth.c14
-rw-r--r--libc/libio/Makefile2
-rw-r--r--libc/libio/iofwrite.c10
-rw-r--r--libc/libio/iofwrite_u.c10
-rw-r--r--libc/libio/tst-fwrite-error.c66
-rw-r--r--libc/localedata/ChangeLog34
-rw-r--r--libc/localedata/SUPPORTED5
-rw-r--r--libc/localedata/locales/ia_FR140
-rw-r--r--libc/localedata/locales/niu_NU193
-rw-r--r--libc/localedata/locales/niu_NZ190
-rw-r--r--libc/localedata/locales/szl_PL2
-rw-r--r--libc/localedata/locales/ug_CN482
-rw-r--r--libc/malloc/mtrace.c9
-rw-r--r--libc/manual/arith.texi4
-rw-r--r--libc/math/libm-test.inc91
-rw-r--r--libc/nptl/ChangeLog21
-rw-r--r--libc/nptl/pthread_cond_timedwait.c9
-rw-r--r--libc/nptl/sysdeps/i386/tls.h5
-rw-r--r--libc/nptl/sysdeps/unix/sysv/linux/sem_post.c2
-rw-r--r--libc/nptl/sysdeps/x86_64/tls.h5
-rw-r--r--libc/nptl/unwind.c2
-rw-r--r--libc/nptl_db/ChangeLog4
-rw-r--r--libc/nptl_db/Makefile2
-rw-r--r--libc/nscd/grpcache.c33
-rw-r--r--libc/nss/getXXbyYY_r.c7
-rw-r--r--libc/nss/makedb.c9
-rw-r--r--libc/ports/ChangeLog.aarch64130
-rw-r--r--libc/ports/ChangeLog.alpha6
-rw-r--r--libc/ports/ChangeLog.arm17
-rw-r--r--libc/ports/ChangeLog.hppa37
-rw-r--r--libc/ports/ChangeLog.ia644
-rw-r--r--libc/ports/ChangeLog.m68k53
-rw-r--r--libc/ports/ChangeLog.mips95
-rw-r--r--libc/ports/ChangeLog.powerpc6
-rw-r--r--libc/ports/ChangeLog.tile15
-rw-r--r--libc/ports/sysdeps/aarch64/dl-tlsdesc.S2
-rw-r--r--libc/ports/sysdeps/aarch64/dl-tlsdesc.h2
-rw-r--r--libc/ports/sysdeps/aarch64/fpu/s_ceil.c21
-rw-r--r--libc/ports/sysdeps/aarch64/fpu/s_ceilf.c21
-rw-r--r--libc/ports/sysdeps/aarch64/fpu/s_floor.c21
-rw-r--r--libc/ports/sysdeps/aarch64/fpu/s_floorf.c21
-rw-r--r--libc/ports/sysdeps/aarch64/fpu/s_fma.c47
-rw-r--r--libc/ports/sysdeps/aarch64/fpu/s_fmaf.c22
-rw-r--r--libc/ports/sysdeps/aarch64/fpu/s_fmax.c21
-rw-r--r--libc/ports/sysdeps/aarch64/fpu/s_fmaxf.c23
-rw-r--r--libc/ports/sysdeps/aarch64/fpu/s_fmin.c49
-rw-r--r--libc/ports/sysdeps/aarch64/fpu/s_fminf.c22
-rw-r--r--libc/ports/sysdeps/aarch64/fpu/s_frint.c49
-rw-r--r--libc/ports/sysdeps/aarch64/fpu/s_frintf.c24
-rw-r--r--libc/ports/sysdeps/aarch64/fpu/s_llrint.c21
-rw-r--r--libc/ports/sysdeps/aarch64/fpu/s_llrintf.c23
-rw-r--r--libc/ports/sysdeps/aarch64/fpu/s_llround.c21
-rw-r--r--libc/ports/sysdeps/aarch64/fpu/s_llroundf.c23
-rw-r--r--libc/ports/sysdeps/aarch64/fpu/s_lrint.c53
-rw-r--r--libc/ports/sysdeps/aarch64/fpu/s_lrintf.c22
-rw-r--r--libc/ports/sysdeps/aarch64/fpu/s_lround.c51
-rw-r--r--libc/ports/sysdeps/aarch64/fpu/s_lroundf.c22
-rw-r--r--libc/ports/sysdeps/aarch64/fpu/s_nearbyint.c21
-rw-r--r--libc/ports/sysdeps/aarch64/fpu/s_nearbyintf.c21
-rw-r--r--libc/ports/sysdeps/aarch64/fpu/s_rint.c21
-rw-r--r--libc/ports/sysdeps/aarch64/fpu/s_rintf.c21
-rw-r--r--libc/ports/sysdeps/aarch64/fpu/s_round.c21
-rw-r--r--libc/ports/sysdeps/aarch64/fpu/s_roundf.c21
-rw-r--r--libc/ports/sysdeps/aarch64/fpu/s_trunc.c21
-rw-r--r--libc/ports/sysdeps/aarch64/fpu/s_truncf.c21
-rw-r--r--libc/ports/sysdeps/aarch64/libm-test-ulps45
-rw-r--r--libc/ports/sysdeps/aarch64/tlsdesc.c2
-rw-r--r--libc/ports/sysdeps/alpha/fpu/libm-test-ulps250
-rw-r--r--libc/ports/sysdeps/alpha/sotruss-lib.c50
-rw-r--r--libc/ports/sysdeps/arm/configure3
-rw-r--r--libc/ports/sysdeps/arm/configure.in3
-rw-r--r--libc/ports/sysdeps/arm/fesetenv.c10
-rw-r--r--libc/ports/sysdeps/arm/libm-test-ulps436
-rw-r--r--libc/ports/sysdeps/hppa/__longjmp.S71
-rw-r--r--libc/ports/sysdeps/hppa/__longjmp.c83
-rw-r--r--libc/ports/sysdeps/hppa/bits/setjmp.h39
-rw-r--r--libc/ports/sysdeps/hppa/fpu/fegetround.c13
-rw-r--r--libc/ports/sysdeps/hppa/fpu/feholdexcpt.c4
-rw-r--r--libc/ports/sysdeps/hppa/fpu/fesetenv.c2
-rw-r--r--libc/ports/sysdeps/hppa/fpu/fpu_control.h66
-rw-r--r--libc/ports/sysdeps/hppa/get-rounding-mode.h35
-rw-r--r--libc/ports/sysdeps/hppa/setjmp.S8
-rw-r--r--libc/ports/sysdeps/m68k/dl-machine.h4
-rw-r--r--libc/ports/sysdeps/m68k/dl-trampoline.S2
-rw-r--r--libc/ports/sysdeps/m68k/m680x0/fpu/libm-test-ulps162
-rw-r--r--libc/ports/sysdeps/m68k/m680x0/fpu/s_atan.c6
-rw-r--r--libc/ports/sysdeps/m68k/m680x0/fpu/s_ccosh.c5
-rw-r--r--libc/ports/sysdeps/m68k/m680x0/fpu/s_cexp.c5
-rw-r--r--libc/ports/sysdeps/m68k/m680x0/fpu/s_csin.c5
-rw-r--r--libc/ports/sysdeps/m68k/m680x0/fpu/s_csinh.c5
-rw-r--r--libc/ports/sysdeps/m68k/m680x0/fpu/s_expm1.c4
-rw-r--r--libc/ports/sysdeps/m68k/m680x0/fpu/s_frexp.c6
-rw-r--r--libc/ports/sysdeps/m68k/m680x0/fpu/s_isinf.c5
-rw-r--r--libc/ports/sysdeps/m68k/m680x0/fpu/s_lrint.c6
-rw-r--r--libc/ports/sysdeps/m68k/m680x0/fpu/s_modf.c6
-rw-r--r--libc/ports/sysdeps/m68k/m680x0/fpu/s_remquo.c5
-rw-r--r--libc/ports/sysdeps/m68k/m680x0/fpu/s_scalbn.c11
-rw-r--r--libc/ports/sysdeps/m68k/m680x0/fpu/s_sin.c4
-rw-r--r--libc/ports/sysdeps/m68k/m680x0/fpu/s_sincos.c6
-rw-r--r--libc/ports/sysdeps/m68k/sotruss-lib.c51
-rw-r--r--libc/ports/sysdeps/mips/bits/atomic.h6
-rw-r--r--libc/ports/sysdeps/mips/dl-machine.h2
-rw-r--r--libc/ports/sysdeps/mips/jmpbuf-unwind.h10
-rw-r--r--libc/ports/sysdeps/mips/mips32/libm-test-ulps436
-rw-r--r--libc/ports/sysdeps/mips/mips64/libm-test-ulps863
-rw-r--r--libc/ports/sysdeps/mips/mips64/n32/_itoa.h4
-rw-r--r--libc/ports/sysdeps/mips/sotruss-lib.c117
-rw-r--r--libc/ports/sysdeps/powerpc/nofpu/libm-test-ulps735
-rw-r--r--libc/ports/sysdeps/tile/bits/byteswap.h4
-rw-r--r--libc/ports/sysdeps/tile/libm-test-ulps34
-rw-r--r--libc/ports/sysdeps/tile/s_fma.c4
-rw-r--r--libc/ports/sysdeps/tile/s_fmaf.c4
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/aarch64/dl-cache.h45
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/aarch64/nptl/lowlevellock.h2
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/arm/Makefile23
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/hppa/____longjmp_chk.c47
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/hppa/bits/socket.h444
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/hppa/bits/socket_type.h55
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/hppa/mmap.c4
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/hppa/nptl/pthread_once.c4
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/m68k/nptl/lowlevellock.h14
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/m68k/nptl/sysdep-cancel.h10
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/____longjmp_chk.c4
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h56
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h6
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/sendfile64.c1
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/syscalls.list2
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h48
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/register-dump.h41
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/sigcontextinfo.h14
-rw-r--r--libc/posix/bits/posix1_lim.h8
-rw-r--r--libc/resolv/nss_dns/dns-host.c25
-rw-r--r--libc/resolv/res_query.c30
-rw-r--r--libc/resolv/res_send.c2
-rw-r--r--libc/scripts/abilist.awk2
-rw-r--r--libc/signal/signal.h2
-rw-r--r--libc/socket/Makefile2
-rw-r--r--libc/socket/Versions6
-rw-r--r--libc/socket/recvmmsg.c31
-rw-r--r--libc/socket/sendmmsg.c32
-rw-r--r--libc/socket/sys/socket.h31
-rw-r--r--libc/stdio-common/_itowa.c6
-rw-r--r--libc/sunrpc/bindrsvprt.c11
-rw-r--r--libc/sunrpc/rpc/svc.h17
-rw-r--r--libc/sunrpc/svc.c33
-rw-r--r--libc/sunrpc/svc_tcp.c18
-rw-r--r--libc/sunrpc/svc_udp.c25
-rw-r--r--libc/sunrpc/svc_unix.c18
-rw-r--r--libc/sysdeps/generic/ldconfig.h4
-rw-r--r--libc/sysdeps/generic/unwind-dw2-fde-glibc.c5
-rw-r--r--libc/sysdeps/generic/unwind-dw2-fde.c27
-rw-r--r--libc/sysdeps/i386/fpu/e_powl.S55
-rw-r--r--libc/sysdeps/i386/fpu/libm-test-ulps52
-rw-r--r--libc/sysdeps/ieee754/flt-32/e_j0f.c2
-rw-r--r--libc/sysdeps/ieee754/flt-32/e_j1f.c2
-rw-r--r--libc/sysdeps/ieee754/ldbl-128/e_j0l.c3
-rw-r--r--libc/sysdeps/ieee754/ldbl-128/e_j1l.c2
-rw-r--r--libc/sysdeps/ieee754/ldbl-128/e_powl.c6
-rw-r--r--libc/sysdeps/ieee754/ldbl-128/s_atanl.c17
-rw-r--r--libc/sysdeps/ieee754/ldbl-128/s_nearbyintl.c2
-rw-r--r--libc/sysdeps/ieee754/ldbl-128/s_rintl.c2
-rw-r--r--libc/sysdeps/ieee754/ldbl-128ibm/e_hypotl.c4
-rw-r--r--libc/sysdeps/ieee754/ldbl-128ibm/e_powl.c6
-rw-r--r--libc/sysdeps/ieee754/ldbl-128ibm/s_atanl.c16
-rw-r--r--libc/sysdeps/ieee754/ldbl-128ibm/s_expm1l.c2
-rw-r--r--libc/sysdeps/ieee754/ldbl-128ibm/s_fmal.c8
-rw-r--r--libc/sysdeps/ieee754/ldbl-96/e_asinl.c9
-rw-r--r--libc/sysdeps/mach/hurd/ptsname.c18
-rw-r--r--libc/sysdeps/mach/hurd/syncfs.c (renamed from libc/ports/sysdeps/unix/sysv/linux/ia64/clock_getcpuclockid.c)28
-rw-r--r--libc/sysdeps/posix/getaddrinfo.c6
-rw-r--r--libc/sysdeps/powerpc/fpu/libm-test-ulps41
-rw-r--r--libc/sysdeps/powerpc/powerpc64/entry.h6
-rw-r--r--libc/sysdeps/sh/dl-machine.h4
-rw-r--r--libc/sysdeps/sparc/fpu/libm-test-ulps75
-rw-r--r--libc/sysdeps/unix/make-syscalls.sh16
-rw-r--r--libc/sysdeps/unix/sysv/linux/Makefile3
-rw-r--r--libc/sysdeps/unix/sysv/linux/bits/socket.h33
-rw-r--r--libc/sysdeps/unix/sysv/linux/clock_getcpuclockid.c4
-rw-r--r--libc/sysdeps/unix/sysv/linux/internal_sendmmsg.S9
-rw-r--r--libc/sysdeps/unix/sysv/linux/recvmmsg.c11
-rw-r--r--libc/sysdeps/unix/sysv/linux/sendmmsg.c18
-rw-r--r--libc/sysdeps/unix/sysv/linux/sys/sysctl.h18
-rw-r--r--libc/sysdeps/x86/fpu/Makefile3
-rw-r--r--libc/sysdeps/x86/fpu/powl_helper.c211
-rw-r--r--libc/sysdeps/x86_64/bits/atomic.h21
-rw-r--r--libc/sysdeps/x86_64/fpu/e_powl.S52
-rw-r--r--libc/sysdeps/x86_64/fpu/libm-test-ulps42
-rw-r--r--libc/sysdeps/x86_64/multiarch/test-multiarch.c2
220 files changed, 7708 insertions, 1604 deletions
diff --git a/libc/ChangeLog b/libc/ChangeLog
index 82c48f8fd..ff6a493c8 100644
--- a/libc/ChangeLog
+++ b/libc/ChangeLog
@@ -1,3 +1,565 @@
+2012-12-01 Joseph Myers <joseph@codesourcery.com>
+
+ * manual/arith.texi (feenableexcept): Fix typo.
+ (fedisableexcept): Likewise.
+
+2012-11-30 Roland McGrath <roland@hack.frob.com>
+
+ * sysdeps/powerpc/powerpc64/entry.h (TEXT_START): Define using a
+ second, differently-typed declaration, rather than a cast.
+
+2012-11-30 Siddhesh Poyarekar <siddhesh@redhat.com>
+
+ * sunrpc/rpc/svc.h (__svc_accept_failed): Move declaration...
+ * include/rpc/svc.h: ... here.
+
+2012-11-30 Aurelien Jarno <aurel32@debian.org>
+
+ [BZ #13013]
+ * resolv/res_query.c(__libc_res_nquery): Assign hp and hp2
+ depending n and resplen2 to catch cases where answer
+ equals answerp2.
+
+2012-11-29 Carlos O'Donell <carlos@systemhalted.org>
+
+ * elf/get-dynamic-info.h (elf_get_dynamic_info): Warn
+ for unsupported DF_1_* bits when DL_DEBUG_FILES is set.
+
+2012-11-29 Mike Frysinger <vapier@gentoo.org>
+
+ * sysdeps/unix/sysv/linux/clock_getcpuclockid.c (HAS_CPUCLOCK): Delete.
+
+2012-11-29 Roland McGrath <roland@hack.frob.com>
+
+ * inet/tst-inet6_rth.c (do_test): Use a union rather than type punning.
+
+2012-11-28 Jeff Law <law@redhat.com>
+
+ [BZ #13761]
+ * nscd/grpcache.c (cache_addgr): Rename alloca_used to
+ dataset_temporary. Track alloca usage into alloca_used.
+ If dataset is large allocate and release it via malloc/free.
+
+2012-06-04 Florian Weimer <fweimer@redhat.com>
+
+ [BZ #14197]
+ * debug/test-strcpy_chk.c: Mention __chk_fail ABI test.
+
+2012-11-28 David S. Miller <davem@davemloft.net>
+
+ * sysdeps/sparc/fpu/libm-test-ulps: Update.
+
+2012-11-28 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #14803]
+ * sysdeps/ieee754/ldbl-96/e_asinl.c (pio2_hi): Use hex float value
+ of pi/2 rounded to nearest to 64 bits.
+ (pio2_lo): Use hex float value of pi/2 - pio2_hi rounded to
+ nearest to 64 bits.
+ (pio4_hi): Use hex float value of pi/4 rounded to nearest to 64
+ bits.
+
+2012-11-28 Jeff Law <law@redhat.com>
+ Martin Osvald <mosvald@redhat.com>
+
+ [BZ #14889]
+ * sunrpc/rpc/svc.h (__svc_accept_failed): New prototype.
+ * sunrpc/svc.c: Include time.h.
+ (__svc_accept_failed): New function.
+ * sunrpc/svc_tcp.c (rendezvous_request): If the accept fails for
+ any reason other than EINTR, call __svc_accept_failed.
+ * sunrpc/svc_udp.c (svcudp_recv): Similarly.
+ * sunrpc/svc_unix.c (rendezvous_request): Similarly.
+
+2012-11-28 Andreas Schwab <schwab@suse.de>
+
+ * scripts/abilist.awk: Also handle indirect functions in .opd
+ section.
+
+2012-11-28 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #13881]
+ * sysdeps/x86/fpu/powl_helper.c: New file.
+ * sysdeps/x86/fpu/Makefile: Likewise.
+ * sysdeps/i386/fpu/e_powl.S (limit): Remove object.
+ (p3): New object.
+ (__ieee754_powl): Use __powl_helper for finite arguments except
+ integer exponents below 8.
+ * sysdeps/x86_64/fpu/e_powl.S (limit): Remove object.
+ (p3): New object.
+ (__ieee754_powl): Use __powl_helper for finite arguments except
+ integer exponents below 8.
+ * math/libm-test.inc (pow_test): Add more tests and enable some
+ previously disabled tests.
+ * sysdeps/i386/fpu/libm-test-ulps: Update.
+ * sysdeps/x86_64/fpu/libm-test-ulps: Likewise.
+
+2012-11-28 Siddhesh Poyarekar <siddhesh@redhat.com>
+ Carlos O'Donell <carlos_odonell@mentor.com>
+
+ * nss/makedb.c (is_prime): Assert that input is odd and greater
+ than 4. Note that fact in a comment too.
+ (next_prime): Add 4 to input.
+
+2012-11-27 Siddhesh Poyarekar <siddhesh@redhat.com>
+
+ [BZ #11741]
+ * libio/Makefile (tests): Add test case tst-fwrite-error.
+ * libio/iofwrite.c (_IO_fwrite): Return 0 on EOF.
+ * libio/iofwrite_u.c (fwrite_unlocked): Likewise.
+ * libio/tst-fwrite-error.c: New test case.
+
+2012-11-26 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elf/dl-load.c (_dl_map_object_from_fd): Cast to uintptr_t
+ before casting to void *.
+ * include/libc-internal.h (__pointer_type): New macro.
+ (__integer_if_pointer_type_sub): Likewise.
+ (__integer_if_pointer_type): Likewise.
+ (cast_to_integer): Likewise.
+ * sysdeps/x86_64/bits/atomic.h: Include <libc-internal.h>.
+ (__arch_c_compare_and_exchange_val_64_acq): Use cast_to_integer
+ before casting to atomic64_t.
+ (atomic_exchange_acq): Likewise.
+ (__arch_exchange_and_add_body): Likewise.
+ (__arch_add_body): Likewise.
+ (atomic_add_negative): Likewise.
+ (atomic_add_zero): Likewise.
+
+2012-11-26 Joseph Myers <joseph@codesourcery.com>
+
+ * sysdeps/generic/unwind-dw2-fde.c (get_pc_begin): New function.
+ (fde_unencoded_compare): Use get_pc_begin instead of type-punning.
+ (add_fdes): Likewise.
+ (linear_search_fdes): Likewise.
+ (binary_search_unencoded_fdes): Likewise.
+
+2012-11-26 Andreas Schwab <schwab@linux-m68k.org>
+
+ * elf/sotruss.ksh: Correctly locate argument of -F and -T options.
+
+2012-11-24 Adam Conrad <adconrad@0c3.net>
+
+ * configure.in: Autodetect C++ header directories.
+ * configure: Regenerated.
+
+2012-11-23 Mike Frysinger <vapier@gentoo.org>
+
+ * elf/Makefile ($(objpfx)ld.so): Change readelf to $(READELF).
+
+2012-11-23 Andreas Schwab <schwab@linux-m68k.org>
+
+ * sysdeps/powerpc/fpu/libm-test-ulps: Update.
+
+2012-11-22 Joseph Myers <joseph@codesourcery.com>
+
+ * math/libm-test.inc (fma_test_towardzero) [TEST_LDOUBLE &&
+ LDBL_MANT_DIG == 106]: Disable some tests.
+ (fma_test_downward) [TEST_LDOUBLE && LDBL_MANT_DIG == 106]:
+ Likewise.
+ (fma_test_upward) [TEST_LDOUBLE && LDBL_MANT_DIG == 106]:
+ Likewise.
+
+ [BZ #14871]
+ * sysdeps/ieee754/ldbl-128ibm/s_atanl.c (__atanl): Return the
+ input for small inputs. Return +/- pi/2 for large inputs.
+ * math/libm-test.inc (atan_test): Add more tests.
+
+ * sysdeps/generic/unwind-dw2-fde-glibc.c
+ (_Unwind_IteratePhdrCallback): Declare P_DYNAMIC with
+ __attribute__ ((unused)).
+
+ [BZ #14645]
+ * sysdeps/ieee754/ldbl-128ibm/s_fmal.c (__fmal): Compute result as
+ x * y if x and y are nonzero and z is zero.
+
+ [BZ #14811]
+ * sysdeps/ieee754/ldbl-128ibm/e_powl.c (__ieee754_powl): Saturate
+ nonzero exponents with absolute value below 0x1p-117 to +/-
+ 0x1p-117.
+
+ [BZ #14869]
+ * sysdeps/ieee754/ldbl-128ibm/e_hypotl.c (__ieee754_hypotl): Scale
+ up arguments below 2**-450, not just those below 2**-500.
+ * math/libm-test.inc (hypot_test): Add another test.
+
+ [BZ #14868]
+ * sysdeps/ieee754/ldbl-128ibm/e_hypotl.c (__ieee754_hypotl):
+ Return a+b for ratio over 2**120, not 2**60.
+ * math/libm-test.inc (hypot_test): Add another test.
+
+ * math/libm-test.inc (clog_test): Use
+ UNDERFLOW_EXCEPTION_LDOUBLE_IBM on two tests.
+ (clog10_test): Likewise.
+
+ [BZ #6778]
+ * sysdeps/ieee754/ldbl-128ibm/s_expm1l.c (big): Change to 1e290L.
+
+2012-11-22 Andreas Schwab <schwab@suse.de>
+
+ * sysdeps/i386/fpu/libm-test-ulps: Update.
+
+2012-11-22 Pino Toscano <toscano.pino@tiscali.it>
+
+ * sysdeps/x86_64/multiarch/test-multiarch.c (get_cpuinfo): Terminate
+ printf output with newline.
+
+2012-11-21 H.J. Lu <hongjiu.lu@intel.com>
+
+ [BZ #14865]
+ * aclocal.m4 (LIBC_LINKER_FEATURE): New macro.
+ * configure.in: Use LIBC_LINKER_FEATURE to check -z nodelete,
+ -z nodlopen, -z initfirst and -z execstack support.
+ * configure: Regenerated.
+
+ * elf/elf.h (DF_1_NODIRECT): New macro.
+ (DF_1_IGNMULDEF): Likewise.
+ (DF_1_NOKSYMS): Likewise.
+ (DF_1_NOHDR): Likewise.
+ (DF_1_EDITED): Likewise.
+ (DF_1_NORELOC): Likewise.
+ (DF_1_SYMINTPOSE): Likewise.
+ (DF_1_GLOBAUDIT): Likewise.
+ (DF_1_SINGLETON): Likewise.
+ * elf/get-dynamic-info.h (elf_get_dynamic_info): Assert
+ DT_1_SUPPORTED_MASK bits.
+ * include/elf.h (DT_1_SUPPORTED_MASK): New macro.
+
+2012-11-20 Carlos O'Donell <carlos_odonell@mentor.com>
+
+ * sysdeps/unix/make-syscalls.sh: Document prefixes.
+
+2012-11-20 Thomas Schwinge <thomas@codesourcery.com>
+
+ * sysdeps/sh/dl-machine.h (ELF_MACHINE_RUNTIME_FIXUP_PARAMS): New
+ macro.
+
+ * sysdeps/unix/sysv/linux/bits/socket.h (struct mmsghdr, recvmmsg)
+ (sendmmsg): Move declarations...
+ * socket/sys/socket.h: ... here.
+ * sysdeps/unix/sysv/linux/recvmmsg.c [!defined __NR_recvmmsg &&
+ !defined __NR_socketcall] (recvmmsg): Move ENOSYS stub into and
+ include it from...
+ * socket/recvmmsg.c: ... this new file.
+ * sysdeps/unix/sysv/linux/internal_sendmmsg.S [__ASSUME_SENDMMSG]
+ (sendmmsg): Rename to __sendmmsg, create weak alias and make
+ definition of __sendmmsg hidden.
+ * sysdeps/unix/sysv/linux/sendmmsg.c (sendmmsg): Likewise.
+ [!defined __NR_sendmmsg && !defined __NR_socketcall] (sendmmsg):
+ Move ENOSYS stub into and include it from...
+ * socket/sendmmsg.c: ... this new file.
+ * sysdeps/unix/sysv/linux/Makefile [subdir=socket]
+ (sysdep_routines): Move recvmmsg and sendmmsg...
+ * socket/Makefile (routines): ... here.
+ * socket/Versions (GLIBC_2.17): Add recvmmsg and sendmmsg.
+ (GLIBC_PRIVATE): Add __sendmmsg.
+ * include/sys/socket.h (__sendmmsg): Add declarations.
+ * resolv/res_send.c (send_dg): Invoke __sendmmsg instead of
+ sendmmsg.
+
+2012-11-20 Joseph Myers <joseph@codesourcery.com>
+
+ * sysdeps/ieee754/ldbl-128/s_nearbyintl.c (__nearbyintl): Mark
+ variable I1 with __attribute__ ((unused)).
+ * sysdeps/ieee754/ldbl-128/s_rintl.c (__rintl): Likewise.
+
+2012-11-19 Joseph Myers <joseph@codesourcery.com>
+
+ * stdio-common/_itowa.c (_itowa) [BITS_PER_MP_LIMB == 64]: Declare
+ DUMMY variables with __attribute__ ((unused)).
+
+ * bits/byteswap.h: Include <bits/types.h>.
+ (__bswap_64): Use __uint64_t instead of unsigned long long int.
+
+2012-11-19 Pino Toscano <toscano.pino@tiscali.it>
+
+ * sysdeps/mach/hurd/ptsname.c (ptsname): Change the type of PEERNAME to
+ string_t. Do not manually set errno.
+ (__ptsname_r): Change the type of PEERNAME to string_t, and check its
+ length with __strnlen. Make sure to both set errno and return it on
+ failure.
+
+2012-11-19 David S. Miller <davem@davemloft.net>
+
+ With help from Joseph Myers.
+ * sysdeps/ieee754/ldbl-128/s_atanl.c (__atanl): Handle tiny and
+ very large arguments properly.
+ * math/libm-test.inc (atan_test): New tests.
+ (atan2_test): New tests.
+ * sysdeps/sparc/fpu/libm-test-ulps: Update.
+ * sysdeps/x86_64/fpu/libm-test-ulps: Update.
+
+2012-11-19 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #14856]
+ * posix/bits/posix1_lim.h [!__USE_XOPEN2K] (_POSIX_TZNAME_MAX):
+ Define to 3.
+
+ * conform/data/errno.h-data [POSIX] (EADDRINUSE): Do not expect.
+ [POSIX] (EADDRNOTAVAIL): Likewise.
+ [POSIX] (EAFNOSUPPORT): Likewise.
+ [POSIX] (EALREADY): Likewise.
+ [POSIX] (ECONNABORTED): Likewise.
+ [POSIX] (ECONNREFUSED): Likewise.
+ [POSIX] (ECONNRESET): Likewise.
+ [POSIX] (EDESTADDRREQ): Likewise.
+ [POSIX] (EDQUOT): Likewise.
+ [POSIX] (EHOSTUNREACH): Likewise.
+ [POSIX] (EIDRM): Likewise.
+ [POSIX] (EISCONN): Likewise.
+ [POSIX] (ELOOP): Likewise.
+ [POSIX] (EMULTIHOP): Likewise.
+ [POSIX] (ENETDOWN): Likewise.
+ [POSIX] (ENETUNREACH): Likewise.
+ [POSIX] (ENOBUFS): Likewise.
+ [POSIX] (ENODATA): Likewise.
+ [POSIX] (ENOLINK): Likewise.
+ [POSIX] (ENOMSG): Likewise.
+ [POSIX] (ENOPROTOOPT): Likewise.
+ [POSIX] (ENOSR): Likewise.
+ [POSIX] (ENOSTR): Likewise.
+ [POSIX] (ENOTCONN): Likewise.
+ [POSIX] (ENOTSOCK): Likewise.
+ [POSIX] (EOPNOTSUPP): Likewise.
+ [POSIX] (EOVERFLOW): Likewise.
+ [POSIX] (EPROTO): Likewise.
+ [POSIX] (EPROTONOSUPPORT): Likewise.
+ [POSIX] (EPROTOTYPE): Likewise.
+ [POSIX] (ESTALE): Likewise.
+ [POSIX] (ETIME): Likewise.
+ [POSIX] (ETXTBSY): Likewise.
+ [POSIX] (EWOULDBLOCK): Likewise.
+ [!ISO && !ISO99 && !ISO11] (E*): Do not allow.
+ * conform/data/fcntl.h-data [POSIX] (SEEK_SET): Allow.
+ [POSIX] (SEEK_CUR): Likewise.
+ [POSIX] (SEEK_END): Likewise.
+ [POSIX || UNIX98] (mode_t): Do not require.
+ [POSIX] (off_t): Likewise.
+ [POSIX] (pid_t): Likewise.
+ [POSIX] (sys/stat.h): Do not allow header.
+ [POSIX] (unistd.h): Likewise.
+ [!ISO && !ISO99 && !ISO11] (timespec): Do not allow.
+ [!ISO && !ISO99 && !ISO11] (tv_nsec): Likewise.
+ [!ISO && !ISO99 && !ISO11] (tv_sec): Likewise.
+ * conform/data/locale.h-data [POSIX] (LC_MESSAGES): Do not
+ require.
+ * conform/data/mqueue.h-data [!ISO && !ISO99 && !ISO11] (struct
+ sigevent): Specify elements.
+ [XOPEN2K8 || POSIX2008] (struct sigevent): Remove duplicate type
+ entry.
+ [!ISO && !ISO99 && !ISO11] (mq_*): Allow.
+ [!ISO && !ISO99 && !ISO11] (MQ_*): Likewise.
+
+ * conform/data/cpio.h-data [POSIX]: Disable whole file.
+ * conform/data/glob.h-data [POSIX] (GLOB_NOSYS): Do not expect.
+ * conform/data/limits.h-data [!ISO && !ISO99 && !ISO11]
+ (AIO_LIST_MAX): Change to AIO_LISTIO_MAX.
+ [!ISO && !ISO99 && !ISO11] (ATEXT_MAX): Remove.
+ [!ISO && !ISO99 && !ISO11 && !POSIX && !XPG3] (ATEXIT_MAX): Allow.
+ [POSIX || POSIX2008 || XPG3] (IOV_MAX): Do not allow.
+ [POSIX || POSIX2008 || XPG3] (_XOPEN_IOV_MAX): Likewise.
+ [!ISO && !ISO99 && !ISO11] (MQ_PRIO_MAX): Allow.
+ [!ISO && !ISO99 && !ISO11] (RE_DUP_MAX): Remove duplicate entry.
+ [POSIX || XPG3 || XPG4 || UNIX98] (SS_REPL_MAX): Do not allow.
+ [POSIX || XPG3 || XPG4 || UNIX98] (SYMLOOP_MAX): Likewise.
+ [POSIX || XPG3 || XPG4] (FILESIZEBITS): Likewise.
+ [POSIX || XPG3 || XPG4 || UNIX98] (POSIX_ALLOC_SIZE_MIN):
+ Likewise.
+ [POSIX || XPG3 || XPG4 || UNIX98] (POSIX_REC_INCR_XFER_SIZE):
+ Likewise.
+ [POSIX || XPG3 || XPG4 || UNIX98] (POSIX_REC_MAX_XFER_SIZE):
+ Likewise.
+ [POSIX || XPG3 || XPG4 || UNIX98] (POSIX_REC_XFER_ALIGN):
+ Likewise.
+ [POSIX || XPG3 || XPG4 || UNIX98] (SYMLINK_MAX): Likewise.
+ [POSIX || XPG3 || XPG4 || UNIX98] (_POSIX_SS_REPL_MAX): Likewise.
+ [POSIX || XPG3 || XPG4 || UNIX98] (_POSIX_SYMLINK_MAX): Likewise.
+ [POSIX || XPG3 || XPG4 || UNIX98] (_POSIX_SYMLOOP_MAX): Likewise.
+ [!ISO && !ISO99 && !ISO11] (BC_BASE_MAX): Use macro-constant.
+ Specify lower bound on value.
+ [!ISO && !ISO99 && !ISO11] (BC_DIM_MAX): Likewise.
+ [!ISO && !ISO99 && !ISO11] (BC_SCALE_MAX): Likewise.
+ [!ISO && !ISO99 && !ISO11] (BC_STRING_MAX): Likewise.
+ [!ISO && !ISO99 && !ISO11] (COLL_WEIGHTS_MAX): Likewise.
+ [!ISO && !ISO99 && !ISO11] (EXPR_NEST_MAX): Likewise.
+ [!ISO && !ISO99 && !ISO11] (RE_DUP_MAX): Likewise
+ [POSIX || XPG3 || XPG4] (CHARCLASS_NAME_MAX): Do not allow.
+ [!ISO && !ISO99 && !ISO11] (_POSIX_CLOCKRES_MIN): Specify exact
+ value.
+ [!ISO && !ISO99 && !ISO11] (_POSIX_AIO_LISTIO_MAX): Do not specify
+ as optional.
+ [!ISO && !ISO99 && !ISO11] (_POSIX_AIO_MAX): Likewise.
+ [!ISO && !ISO99 && !ISO11] (_POSIX_ARG_MAX): Likewise.
+ [!ISO && !ISO99 && !ISO11] (_POSIX_CHILD_MAX): Likewise.
+ [!ISO && !ISO99 && !ISO11] (_POSIX_DELAYTIMER_MAX): Likewise.
+ [!ISO && !ISO99 && !ISO11] (_POSIX_LINK_MAX): Likewise.
+ [!ISO && !ISO99 && !ISO11] (_POSIX_LOGIN_NAME_MAX): Likewise.
+ [!ISO && !ISO99 && !ISO11] (_POSIX_MAX_CANON): Likewise.
+ [!ISO && !ISO99 && !ISO11] (_POSIX_MAX_INPUT): Likewise.
+ [!ISO && !ISO99 && !ISO11] (_POSIX_MQ_OPEN_MAX): Likewise.
+ [!ISO && !ISO99 && !ISO11] (_POSIX_MQ_PRIO_MAX): Likewise.
+ [!ISO && !ISO99 && !ISO11] (_POSIX_NAME_MAX): Likewise.
+ [!ISO && !ISO99 && !ISO11] (_POSIX_NGROUPS_MAX): Likewise.
+ [!ISO && !ISO99 && !ISO11] (_POSIX_OPEN_MAX): Likewise.
+ [!ISO && !ISO99 && !ISO11] (_POSIX_PATH_MAX): Likewise.
+ [!ISO && !ISO99 && !ISO11] (_POSIX_PIPE_BUF): Likewise.
+ [!ISO && !ISO99 && !ISO11] (_POSIX2_RE_DUP_MAX): Remove duplicate
+ entry.
+ [!ISO && !ISO99 && !ISO11] (_POSIX_RTSIG_MAX): Do not specify as
+ optional.
+ [!ISO && !ISO99 && !ISO11] (_POSIX_SEM_NSEMS_MAX): Likewise.
+ [!ISO && !ISO99 && !ISO11] (_POSIX_SEM_VALUE_MAX): Likewise.
+ [!ISO && !ISO99 && !ISO11] (_POSIX_SIGQUEUE_MAX): Likewise.
+ [!ISO && !ISO99 && !ISO11] (_POSIX_SSIZE_MAX): Likewise.
+ [!ISO && !ISO99 && !ISO11] (_POSIX_STREAM_MAX): Likewise.
+ [!ISO && !ISO99 && !ISO11] (_POSIX_THREAD_DESTRUCTOR_ITERATIONS):
+ Likewise.
+ [!ISO && !ISO99 && !ISO11] (_POSIX_THREAD_KEYS_MAX): Likewise.
+ [!ISO && !ISO99 && !ISO11] (_POSIX_THREAD_THREADS_MAX): Likewise.
+ [!ISO && !ISO99 && !ISO11] (_POSIX_TIMER_MAX): Likewise.
+ [!ISO && !ISO99 && !ISO11] (_POSIX_TTY_NAME_MAX): Likewise.
+ [!ISO && !ISO99 && !ISO11] (_POSIX_TZNAME_MAX): Likewise. Give
+ value as 3 for [POSIX || XPG3 || XPG4 || UNIX98].
+ [!ISO && !ISO99 && !ISO11] (_POSIX2_BC_BASE_MAX): Do not specify
+ as optional.
+ [!ISO && !ISO99 && !ISO11] (_POSIX2_BC_DIM_MAX): Likewise.
+ [!ISO && !ISO99 && !ISO11] (_POSIX2_BC_SCALE_MAX): Likewise.
+ [!ISO && !ISO99 && !ISO11] (_POSIX2_BC_STRING_MAX): Likewise.
+ [!ISO && !ISO99 && !ISO11] (_POSIX2_CHARCLASS_NAME_MAX):
+ Likewise. Do not allow for [POSIX || XPG3 || XPG4 || UNIX98].
+ [!ISO && !ISO99 && !ISO11] (_POSIX2_COLL_WEIGHTS_MAX): Do not
+ specify as optional.
+ [!ISO && !ISO99 && !ISO11] (_POSIX2_EXPR_NEST_MAX): Likewise.
+ [!ISO && !ISO99 && !ISO11] (_POSIX2_LINE_MAX): Likewise.
+ [!ISO && !ISO99 && !ISO11] (_POSIX2_RE_DUP_MAX): Likewise.
+ [POSIX || POSIX2008 || XPG3] (_XOPEN_IOV_MAX): Do not allow.
+ [POSIX || XPG3] (NL_ARGMAX): Do not allow.
+ [XPG3] (NL_LANGMAX): Likewise.
+ [POSIX || XPG3] (NL_MSGMAX): Likewise.
+ [POSIX || XPG3] (NL_NMAX): Likewise.
+ [POSIX || XPG3] (NL_SETMAX): Likewise.
+ [POSIX || XPG3] (NL_TEXTMAX): Likewise.
+ [XPG3] (NZERO): Likewise.
+ [XPG4 || UNIX98] (TMP_MAX): Only enable for these conditions.
+ [POSIX || XPG3 || XPG4 || UNIX98] (*_MIN): Do not allow.
+ [!ISO && !ISO99 && !ISO11] (*_t): Allow.
+ * conform/data/regex.h-data [!ISO && !ISO99 && !ISO11]
+ (REG_ERANGE): Expect.
+ * conform/data/stdio.h-data [POSIX] (L_cuserid): Use
+ optional-constant.
+ [POSIX || XOPEN2K || XOPEN2K8 || POSIX2008] (getchar_unlocked):
+ Use (void) in prototype.
+ [POSIX] (*_t): Allow.
+ * conform/data/sys/times.h-data [POSIX]: Enable whole file.
+ * conform/data/wordexp.h-data [!ISO && !ISO99 && !ISO11]
+ (WRDE_BADVAL): Expect.
+
+ * conform/data/fcntl.h-data [XPG3 || XPG4] (O_DSYNC): Do not
+ expect.
+ [XPG3 || XPG4] (O_RSYNC): Likewise.
+ * conform/data/signal.h-data [XPG3 || XPG4] (pthread_kill):
+ Likewise.
+ [XPG3 || XPG4] (pthread_sigmask): Likewise.
+ [XPG3 || XPG4] (sigqueue): Likewise.
+ [XPG3 || XPG4] (sigtimedwait): Likewise.
+ [XPG3 || XPG4] (sigwaitinfo): Likewise.
+ * conform/data/stdio.h-data [XPG3 || XPG4] (snprintf): Likewise.
+ [XPG3 || XPG4] (vsnprintf): Likewise.
+ * conform/data/sys/stat.h-data [XPG3 || XPG4] (blkcnt_t):
+ Likewise.
+ [XPG3 || XPG4] (blksize_t): Likewise.
+ * conform/data/time.h-data [XPG3 || XPG4] (struct timespec):
+ Likewise.
+ [XPG3 || XPG4] (CLOCK_PROCESS_CPUTIME_ID): Likewise.
+ [XPG3 || XPG4] (CLOCK_THREAD_CPUTIME_ID): Likewise.
+ [XPG3 || XPG4] (struct itimerspec): Likewise.
+ [XPG3 || XPG4] (CLOCK_REALTIME): Likewise.
+ [XPG3 || XPG4] (TIMER_ABSTIME): Likewise.
+ [XPG3 || XPG4] (CLOCK_MONOTONIC): Likewise.
+ [XPG3 || XPG4] (clockid_t): Likewise.
+ [XPG3 || XPG4] (timer_t): Likewise.
+ [XPG3 || XPG4] (clock_getres): Likewise.
+ [XPG3 || XPG4] (clock_gettime): Likewise.
+ [XPG3 || XPG4] (clock_settime): Likewise.
+ [XPG3 || XPG4] (nanosleep): Likewise.
+ [XPG3 || XPG4] (timer_create): Likewise.
+ [XPG3 || XPG4] (timer_delete): Likewise.
+ [XPG3 || XPG4] (timer_gettime): Likewise.
+ [XPG3 || XPG4] (timer_getoverrun): Likewise.
+ [XPG3 || XPG4] (timer_settime): Likewise.
+ * conform/data/unistd.h-data [XPG3 || XPG4] (fdatasync): Likewise.
+ [XPG3 || XPG4] (getlogin_r): Likewise.
+ [XPG3 || XPG4] (pread): Likewise.
+ [XPG3 || XPG4] (pthread_atfork): Likewise.
+ [XPG3 || XPG4] (pwrite): Likewise.
+
+ [BZ #14835]
+ * signal/signal.h [__USE_XOPEN_EXTENDED]: Include
+ <bits/siginfo.h>.
+
+2012-11-19 Pino Toscano <toscano.pino@tiscali.it>
+
+ * malloc/mtrace.c (muntrace): Reset MALLSTREAM and the hooks before
+ finalizing MALLSTREAM.
+
+ * sysdeps/mach/hurd/syncfs.c: New file.
+
+2012-11-19 Siddhesh Poyarekar <siddhesh@redhat.com>
+
+ [BZ #14719]
+ * nss/getXXbyYY_r.c (INTERNAL (REENTRANT_NAME)): Set h_errno to
+ NETDB_INTERNAL when NSS_STATUS_UNAVAIL.
+ * resolv/nss_dns/dns-host.c (_nss_dns_gethostbyname3_r): Set
+ h_errno to NETDB_INTERNAL when errno is EMFILE or ENFILE.
+ (_nss_dns_gethostbyname4_r): Likewise.
+ * sysdeps/posix/getaddrinfo.c (gaih_inet): Set result to
+ EAI_SYSTEM if NSS_STATUS_UNAVAIL.
+
+2012-11-19 Peng Haitao <penght@cn.fujitsu.com>
+
+ [BZ #13763]
+ * sunrpc/bindrsvprt.c: Add lock to protect static variable.
+
+2012-11-19 Steve McIntyre <steve.mcintyre@linaro.org>
+
+ * sysdeps/generic/ldconfig.h (FLAG_AARCH64_LIB64): New macro.
+ * elf/cache.c (print_entry): Print ",AArch64" for
+ FLAG_AARCH64_LIB64
+
+ * sysdeps/generic/ldconfig.h (FLAG_ARM_LIBHF): New macro.
+ * elf/cache.c (print_entry): Print ",hard-float" for
+ FLAG_ARM_LIBHF.
+
+2012-11-18 David S. Miller <davem@davemloft.net>
+
+ With help from Joseph Myers.
+ * sysdeps/ieee754/flt-32/e_j0f.c (__ieee754_y0f): Adjust tinyness
+ cutoff to 2**-13.
+ * sysdeps/ieee754/flt-32/e_j1f.c (__ieee754_y1f): Adjust tinyness
+ cutoff to 2**-25.
+ * sysdeps/ieee754/ldbl-128/e_j0l.c (U0): New constant.
+ ( __ieee754_y0l): Avoid arithmetic underflow when 'x' is very
+ small.
+ * sysdeps/ieee754/ldbl-128/e_j1l.c (__ieee754_y1l): Likewise.
+ * math/libm-test.inc (y0_test): New tests.
+ (y1_test): New tests.
+ * sysdeps/i386/fpu/libm-test-ulps: Update.
+ * sysdeps/x86_64/fpu/libm-test-ulps: Update.
+ * sysdeps/sparc/fpu/libm-test-ulps: Update.
+
+2012-11-18 Andreas Schwab <schwab@linux-m68k.org>
+
+ * configure.in (libc_cv_ld_gnu_indirect_function): Use .quad on
+ 64-bit targets.
+ * configure: Regenerated.
+
+2012-11-17 David S. Miller <davem@davemloft.net>
+
+ [BZ #14811]
+ * sysdeps/ieee754/ldbl-128/e_powl.c (__ieee754_powl): Saturate
+ nonzero exponents with absolute value below 0x1p-128 to +/-
+ 0x1p-128.
+
2012-11-17 Joseph Myers <joseph@codesourcery.com>
* sysdeps/unix/sysv/linux/fxstatat.c: Include <string.h>.
@@ -727,14 +1289,6 @@
* conform/data/stdbool.h-data: Likewise.
* conform/data/stdnoreturn.h-data: Likewise.
-2012-11-07 Andreas Jaeger <aj@suse.de>
-
- [BZ #14809]
- * sysdeps/unix/sysv/linux/sys/sysctl.h (_UAPI_LINUX_KERNEL_H)
- (_UAPI_LINUX_TYPES_H): Starting with Linux 3.7, the include header
- guards are changed. Only define if not yet defined, #undef back
- after including linux/sysctl.h if defined here.
-
2012-11-07 Roland McGrath <roland@hack.frob.com>
[BZ #14815]
diff --git a/libc/NEWS b/libc/NEWS
index 6e8c6c28d..744df3783 100644
--- a/libc/NEWS
+++ b/libc/NEWS
@@ -9,18 +9,26 @@ Version 2.17
* The following bugs are resolved with this release:
- 1349, 3439, 3479, 3665, 5044, 5246, 5298, 5400, 6530, 6778, 6808, 9685,
- 9914, 10014, 10038, 10631, 10873, 11438, 11607, 11638, 11741, 12140,
- 13412, 13542, 13601, 13603, 13604, 13629, 13679, 13696, 13698, 13717,
- 13741, 13939, 13950, 13952, 13966, 14042, 14047, 14090, 14150, 14151,
- 14152, 14154, 14157, 14166, 14173, 14195, 14237, 14251, 14252, 14283,
- 14298, 14303, 14307, 14328, 14331, 14336, 14337, 14347, 14349, 14368,
- 14376, 14417, 14459, 14476, 14477, 14501, 14505, 14510, 14516, 14518,
- 14519, 14530, 14532, 14538, 14543, 14544, 14545, 14557, 14562, 14568,
- 14576, 14579, 14583, 14587, 14595, 14602, 14610, 14621, 14638, 14645,
- 14648, 14652, 14660, 14661, 14669, 14672, 14683, 14694, 14716, 14743,
- 14767, 14783, 14784, 14785, 14793, 14796, 14797, 14801, 14805, 14807,
- 14809, 14811, 14815, 14821, 14824, 14828, 14831, 14838.
+ 1349, 3439, 3479, 3665, 5044, 5246, 5298, 5400, 6530, 6677, 6778, 6808,
+ 9685, 9914, 10014, 10038, 10631, 10873, 11438, 11607, 11638, 11741, 12140,
+ 13013, 13412, 13542, 13601, 13603, 13604, 13629, 13679, 13696, 13698,
+ 13717, 13741, 13759, 13761, 13763, 13881, 13939, 13950, 13952, 13966,
+ 14042, 14047, 14090, 14150, 14151, 14152, 14154, 14157, 14166, 14173,
+ 14195, 14197, 14237, 14251, 14252, 14283, 14298, 14303, 14307, 14328,
+ 14331, 14336, 14337, 14347, 14349, 14368, 14376, 14417, 14447, 14459,
+ 14476, 14477, 14501, 14505, 14510, 14516, 14518, 14519, 14530, 14532,
+ 14538, 14543, 14544, 14545, 14557, 14562, 14568, 14576, 14579, 14583,
+ 14587, 14595, 14602, 14610, 14621, 14638, 14645, 14648, 14652, 14660,
+ 14661, 14669, 14672, 14683, 14694, 14716, 14719, 14743, 14767, 14783,
+ 14784, 14785, 14793, 14796, 14797, 14801, 14803, 14805, 14807, 14811,
+ 14815, 14821, 14822, 14824, 14828, 14831, 14835, 14838, 14856, 14863,
+ 14865, 14866, 14868, 14869, 14871, 14879, 14889, 14893.
+
+* CVE-2011-4609 svc_run() produces high cpu usage when accept fails with
+ EMFILE has been fixed (Bugzilla #14889).
+
+* The add-on ports collection is now distributed in the "ports" subdirectory
+ of the main GNU C Library distribution, rather than separately.
* Port to ARM AArch64 contributed by Linaro.
@@ -50,6 +58,13 @@ Version 2.17
New configure option --disable-build-nscd avoids building nscd itself;
this is the default if --disable-nscd is used.
+* Improved support for cross-compilation, including cross-testing and
+ bootstrap builds without a previously built glibc.
+
+* New configure options --with-bugurl and --with-pkgversion, for
+ distributors to use to embed their bug-reporting and package version
+ information in --help and --version output.
+
* The ttyname and ttyname_r functions on Linux now fall back to searching for
the tty file descriptor in /dev/pts or /dev if /proc is not available. This
allows creation of chroots without the procfs mounted on /proc.
@@ -67,6 +82,9 @@ Version 2.17
is not linked with -lrt) will no longer implicitly load the pthreads
library at runtime and so will not suffer the overheads associated with
multi-thread support in other code such as the C++ runtime library.
+
+* New locales: ayc_PE, doi_IN, ia_FR, mni_IN, nhn_MX, niu_NU, niu_NZ,
+ sat_IN, and szl_PL.
Version 2.16
diff --git a/libc/aclocal.m4 b/libc/aclocal.m4
index b173e9e33..956ea8616 100644
--- a/libc/aclocal.m4
+++ b/libc/aclocal.m4
@@ -213,3 +213,31 @@ AC_DEFUN([ACX_BUGURL],[
AC_SUBST(REPORT_BUGS_TO)
AC_SUBST(REPORT_BUGS_TEXI)
])
+
+dnl Check linker option support.
+dnl LIBC_LINKER_FEATURE([ld_option], [cc_option], [action-if-true], [action-if-false])
+AC_DEFUN([LIBC_LINKER_FEATURE],
+[AC_MSG_CHECKING([for linker that supports $1])
+libc_linker_feature=no
+if test x"$gnu_ld" = x"yes"; then
+ libc_linker_check=`$LD -v --help 2>/dev/null | grep "\$1"`
+ if test -n "$libc_linker_check"; then
+ cat > conftest.c <<EOF
+int _start (void) { return 42; }
+EOF
+ if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
+ $2 -nostdlib -nostartfiles
+ -fPIC -shared -o conftest.so conftest.c
+ 1>&AS_MESSAGE_LOG_FD])
+ then
+ libc_linker_feature=yes
+ fi
+ rm -f conftest*
+ fi
+fi
+if test $libc_linker_feature = yes; then
+ $3
+else
+ $4
+fi
+AC_MSG_RESULT($libc_linker_feature)])
diff --git a/libc/bits/byteswap.h b/libc/bits/byteswap.h
index 3ca0ad698..e19e91ada 100644
--- a/libc/bits/byteswap.h
+++ b/libc/bits/byteswap.h
@@ -24,6 +24,7 @@
#define _BITS_BYTESWAP_H 1
#include <features.h>
+#include <bits/types.h>
/* Swap bytes in 16 bit value. */
#define __bswap_constant_16(x) \
@@ -70,15 +71,15 @@ __bswap_32 (unsigned int __bsx)
| (((x) & 0x00000000000000ffull) << 56)))
# if __GNUC_PREREQ (4, 2)
-static __inline unsigned long long int
-__bswap_64 (unsigned long long int __bsx)
+static __inline __uint64_t
+__bswap_64 (__uint64_t __bsx)
{
return __builtin_bswap64 (__bsx);
}
# else
# define __bswap_64(x) \
(__extension__ \
- ({ union { __extension__ unsigned long long int __ll; \
+ ({ union { __extension__ __uint64_t __ll; \
unsigned int __l[2]; } __w, __r; \
if (__builtin_constant_p (x)) \
__r.__ll = __bswap_constant_64 (x); \
@@ -101,8 +102,8 @@ __bswap_64 (unsigned long long int __bsx)
| (((x) & 0x000000000000ff00ull) << 40) \
| (((x) & 0x00000000000000ffull) << 56))
-static __inline unsigned long long int
-__bswap_64 (unsigned long long int __bsx)
+static __inline __uint64_t
+__bswap_64 (__uint64_t __bsx)
{
return __bswap_constant_64 (__bsx);
}
diff --git a/libc/configure b/libc/configure
index a9def7c41..fc1408fe2 100755
--- a/libc/configure
+++ b/libc/configure
@@ -4217,7 +4217,7 @@ $as_echo_n "checking for assembler and linker STT_GNU_IFUNC support... " >&6; }
if ${libc_cv_ld_gnu_indirect_function+:} false; then :
$as_echo_n "(cached) " >&6
else
- cat > conftest.s <<EOF
+ cat > conftest.S <<EOF
.type foo,%gnu_indirect_function
foo:
.globl _start
@@ -4225,12 +4225,16 @@ _start:
.globl __start
__start:
.data
+#ifdef _LP64
+.quad foo
+#else
.long foo
+#endif
EOF
libc_cv_ld_gnu_indirect_function=no
if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS \
-nostartfiles -nostdlib \
- -o conftest conftest.s 1>&5 2>&5; then
+ -o conftest conftest.S 1>&5 2>&5; then
# Do a link to see if the backend supports IFUNC relocs.
$READELF -r conftest 1>&5
LC_ALL=C $READELF -r conftest | grep 'no relocations' >/dev/null || {
@@ -5442,12 +5446,11 @@ if test -n "$sysheaders"; then
-isystem `echo $sysheaders | sed 's/:/ -isystem /g'`"
if test -n "$CXX"; then
CXX_SYSINCLUDES=
- cxxmachine=`$CXX -dumpmachine 2>&5` &&
- cxxheaders=`$CXX -v -S -x c++ /dev/null -o /dev/null 2>&1 \
- | sed -n -e '1,/#include/d' -e '/^ \//{p;q;}' | sed 's/ //'`
- test "x$cxxheaders" != x && test "x$i" != "x$cxxheaders" &&
- CXX_SYSINCLUDES="$CXX_SYSINCLUDES -isystem $cxxheaders \
--isystem $cxxheaders/$cxxmachine -isystem $cxxheaders/backward"
+ for cxxheaders in `$CXX -v -S -x c++ /dev/null -o /dev/null 2>&1 \
+ | sed -n -e '1,/#include/d' -e 's/^ \(\/.*\/[cg]++\)/\1/p'`; do
+ test "x$cxxheaders" != x &&
+ CXX_SYSINCLUDES="$CXX_SYSINCLUDES -isystem $cxxheaders"
+ done
fi
fi
@@ -6254,86 +6257,101 @@ if test $libc_cv_cc_with_libunwind = yes; then
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -z nodelete option" >&5
-$as_echo_n "checking for -z nodelete option... " >&6; }
-if ${libc_cv_z_nodelete+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat > conftest.c <<EOF
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for linker that supports -z nodelete" >&5
+$as_echo_n "checking for linker that supports -z nodelete... " >&6; }
+libc_linker_feature=no
+if test x"$gnu_ld" = x"yes"; then
+ libc_linker_check=`$LD -v --help 2>/dev/null | grep "\-z nodelete"`
+ if test -n "$libc_linker_check"; then
+ cat > conftest.c <<EOF
int _start (void) { return 42; }
EOF
-if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
- -fPIC -shared -o conftest.so conftest.c
- -nostartfiles -nostdlib
- -Wl,--enable-new-dtags,-z,nodelete 1>&5'
+ if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
+ -Wl,--enable-new-dtags,-z,nodelete -nostdlib -nostartfiles
+ -fPIC -shared -o conftest.so conftest.c
+ 1>&5'
{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
(eval $ac_try) 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; }
-then
+ then
+ libc_linker_feature=yes
+ fi
+ rm -f conftest*
+ fi
+fi
+if test $libc_linker_feature = yes; then
libc_cv_z_nodelete=yes
else
as_fn_error $? "linker with -z nodelete support required" "$LINENO" 5
fi
-rm -f conftest*
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_z_nodelete" >&5
-$as_echo "$libc_cv_z_nodelete" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_linker_feature" >&5
+$as_echo "$libc_linker_feature" >&6; }
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -z nodlopen option" >&5
-$as_echo_n "checking for -z nodlopen option... " >&6; }
-if ${libc_cv_z_nodlopen+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat > conftest.c <<EOF
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for linker that supports -z nodlopen" >&5
+$as_echo_n "checking for linker that supports -z nodlopen... " >&6; }
+libc_linker_feature=no
+if test x"$gnu_ld" = x"yes"; then
+ libc_linker_check=`$LD -v --help 2>/dev/null | grep "\-z nodlopen"`
+ if test -n "$libc_linker_check"; then
+ cat > conftest.c <<EOF
int _start (void) { return 42; }
EOF
-if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
- -fPIC -shared -o conftest.so conftest.c
- -nostartfiles -nostdlib
- -Wl,--enable-new-dtags,-z,nodlopen 1>&5'
+ if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
+ -Wl,--enable-new-dtags,-z,nodlopen -nostdlib -nostartfiles
+ -fPIC -shared -o conftest.so conftest.c
+ 1>&5'
{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
(eval $ac_try) 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; }
-then
+ then
+ libc_linker_feature=yes
+ fi
+ rm -f conftest*
+ fi
+fi
+if test $libc_linker_feature = yes; then
libc_cv_z_nodlopen=yes
else
as_fn_error $? "linker with -z nodlopen support required" "$LINENO" 5
fi
-rm -f conftest*
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_z_nodlopen" >&5
-$as_echo "$libc_cv_z_nodlopen" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_linker_feature" >&5
+$as_echo "$libc_linker_feature" >&6; }
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -z initfirst option" >&5
-$as_echo_n "checking for -z initfirst option... " >&6; }
-if ${libc_cv_z_initfirst+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat > conftest.c <<EOF
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for linker that supports -z initfirst" >&5
+$as_echo_n "checking for linker that supports -z initfirst... " >&6; }
+libc_linker_feature=no
+if test x"$gnu_ld" = x"yes"; then
+ libc_linker_check=`$LD -v --help 2>/dev/null | grep "\-z initfirst"`
+ if test -n "$libc_linker_check"; then
+ cat > conftest.c <<EOF
int _start (void) { return 42; }
EOF
-if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
- -fPIC -shared -o conftest.so conftest.c
- -nostartfiles -nostdlib
- -Wl,--enable-new-dtags,-z,initfirst 1>&5'
+ if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
+ -Wl,--enable-new-dtags,-z,initfirst -nostdlib -nostartfiles
+ -fPIC -shared -o conftest.so conftest.c
+ 1>&5'
{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
(eval $ac_try) 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; }
-then
+ then
+ libc_linker_feature=yes
+ fi
+ rm -f conftest*
+ fi
+fi
+if test $libc_linker_feature = yes; then
libc_cv_z_initfirst=yes
else
as_fn_error $? "linker with -z initfirst support required" "$LINENO" 5
fi
-rm -f conftest*
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_z_initfirst" >&5
-$as_echo "$libc_cv_z_initfirst" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_linker_feature" >&5
+$as_echo "$libc_linker_feature" >&6; }
# Add-on fragments can set these for other machines.
libc_commonpagesize=${libc_commonpagesize:-no}
@@ -6530,32 +6548,37 @@ if test "$libc_cv_z_combreloc" = yes; then
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -z execstack" >&5
-$as_echo_n "checking for -z execstack... " >&6; }
-if ${libc_cv_z_execstack+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat > conftest.c <<EOF
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for linker that supports -z execstack" >&5
+$as_echo_n "checking for linker that supports -z execstack... " >&6; }
+libc_linker_feature=no
+if test x"$gnu_ld" = x"yes"; then
+ libc_linker_check=`$LD -v --help 2>/dev/null | grep "\-z execstack"`
+ if test -n "$libc_linker_check"; then
+ cat > conftest.c <<EOF
int _start (void) { return 42; }
EOF
-if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
- -fPIC -shared -o conftest.so conftest.c
- -Wl,-z,execstack -nostdlib
- 1>&5'
+ if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
+ -Wl,-z,execstack -nostdlib -nostartfiles
+ -fPIC -shared -o conftest.so conftest.c
+ 1>&5'
{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
(eval $ac_try) 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; }
-then
+ then
+ libc_linker_feature=yes
+ fi
+ rm -f conftest*
+ fi
+fi
+if test $libc_linker_feature = yes; then
libc_cv_z_execstack=yes
else
libc_cv_z_execstack=no
fi
-rm -f conftest*
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_z_execstack" >&5
-$as_echo "$libc_cv_z_execstack" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_linker_feature" >&5
+$as_echo "$libc_linker_feature" >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -fpie" >&5
diff --git a/libc/configure.in b/libc/configure.in
index 27369e764..05cbad50e 100644
--- a/libc/configure.in
+++ b/libc/configure.in
@@ -577,7 +577,7 @@ fi
# For the multi-arch option we need support in the assembler & linker.
AC_CACHE_CHECK([for assembler and linker STT_GNU_IFUNC support],
libc_cv_ld_gnu_indirect_function, [dnl
-cat > conftest.s <<EOF
+cat > conftest.S <<EOF
.type foo,%gnu_indirect_function
foo:
.globl _start
@@ -585,12 +585,16 @@ _start:
.globl __start
__start:
.data
+#ifdef _LP64
+.quad foo
+#else
.long foo
+#endif
EOF
libc_cv_ld_gnu_indirect_function=no
if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS \
-nostartfiles -nostdlib \
- -o conftest conftest.s 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
+ -o conftest conftest.S 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
# Do a link to see if the backend supports IFUNC relocs.
$READELF -r conftest 1>&AS_MESSAGE_LOG_FD
LC_ALL=C $READELF -r conftest | grep 'no relocations' >/dev/null || {
@@ -1014,12 +1018,11 @@ if test -n "$sysheaders"; then
-isystem `echo $sysheaders | sed 's/:/ -isystem /g'`"
if test -n "$CXX"; then
CXX_SYSINCLUDES=
- cxxmachine=`$CXX -dumpmachine 2>&AS_MESSAGE_LOG_FD` &&
- cxxheaders=`$CXX -v -S -x c++ /dev/null -o /dev/null 2>&1 \
- | sed -n -e '1,/#include/d' -e '/^ \//{p;q;}' | sed 's/ //'`
- test "x$cxxheaders" != x && test "x$i" != "x$cxxheaders" &&
- CXX_SYSINCLUDES="$CXX_SYSINCLUDES -isystem $cxxheaders \
--isystem $cxxheaders/$cxxmachine -isystem $cxxheaders/backward"
+ for cxxheaders in `$CXX -v -S -x c++ /dev/null -o /dev/null 2>&1 \
+ | sed -n -e '1,/#include/d' -e 's/^ \(\/.*\/[cg]++\)/\1/p'`; do
+ test "x$cxxheaders" != x &&
+ CXX_SYSINCLUDES="$CXX_SYSINCLUDES -isystem $cxxheaders"
+ done
fi
fi
AC_SUBST(SYSINCLUDES)
@@ -1428,53 +1431,17 @@ if test $libc_cv_cc_with_libunwind = yes; then
AC_DEFINE(HAVE_CC_WITH_LIBUNWIND)
fi
-AC_CACHE_CHECK(for -z nodelete option,
- libc_cv_z_nodelete, [dnl
-cat > conftest.c <<EOF
-int _start (void) { return 42; }
-EOF
-if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
- -fPIC -shared -o conftest.so conftest.c
- -nostartfiles -nostdlib
- -Wl,--enable-new-dtags,-z,nodelete 1>&AS_MESSAGE_LOG_FD])
-then
- libc_cv_z_nodelete=yes
-else
- AC_MSG_ERROR(linker with -z nodelete support required)
-fi
-rm -f conftest*])
+LIBC_LINKER_FEATURE([-z nodelete], [-Wl,--enable-new-dtags,-z,nodelete],
+ [libc_cv_z_nodelete=yes],
+ [AC_MSG_ERROR(linker with -z nodelete support required)])
-AC_CACHE_CHECK(for -z nodlopen option,
- libc_cv_z_nodlopen, [dnl
-cat > conftest.c <<EOF
-int _start (void) { return 42; }
-EOF
-if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
- -fPIC -shared -o conftest.so conftest.c
- -nostartfiles -nostdlib
- -Wl,--enable-new-dtags,-z,nodlopen 1>&AS_MESSAGE_LOG_FD])
-then
- libc_cv_z_nodlopen=yes
-else
- AC_MSG_ERROR(linker with -z nodlopen support required)
-fi
-rm -f conftest*])
+LIBC_LINKER_FEATURE([-z nodlopen], [-Wl,--enable-new-dtags,-z,nodlopen],
+ [libc_cv_z_nodlopen=yes],
+ [AC_MSG_ERROR(linker with -z nodlopen support required)])
-AC_CACHE_CHECK(for -z initfirst option,
- libc_cv_z_initfirst, [dnl
-cat > conftest.c <<EOF
-int _start (void) { return 42; }
-EOF
-if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
- -fPIC -shared -o conftest.so conftest.c
- -nostartfiles -nostdlib
- -Wl,--enable-new-dtags,-z,initfirst 1>&AS_MESSAGE_LOG_FD])
-then
- libc_cv_z_initfirst=yes
-else
- AC_MSG_ERROR(linker with -z initfirst support required)
-fi
-rm -f conftest*])
+LIBC_LINKER_FEATURE([-z initfirst], [-Wl,--enable-new-dtags,-z,initfirst],
+ [libc_cv_z_initfirst=yes],
+ [AC_MSG_ERROR(linker with -z initfirst support required)])
# Add-on fragments can set these for other machines.
libc_commonpagesize=${libc_commonpagesize:-no}
@@ -1612,21 +1579,8 @@ if test "$libc_cv_z_combreloc" = yes; then
fi
AC_SUBST(libc_cv_z_combreloc)
-AC_CACHE_CHECK(for -z execstack,
- libc_cv_z_execstack, [dnl
-cat > conftest.c <<EOF
-int _start (void) { return 42; }
-EOF
-if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
- -fPIC -shared -o conftest.so conftest.c
- -Wl,-z,execstack -nostdlib
- 1>&AS_MESSAGE_LOG_FD])
-then
- libc_cv_z_execstack=yes
-else
- libc_cv_z_execstack=no
-fi
-rm -f conftest*])
+LIBC_LINKER_FEATURE([-z execstack], [-Wl,-z,execstack],
+ [libc_cv_z_execstack=yes], [libc_cv_z_execstack=no])
AC_SUBST(libc_cv_z_execstack)
AC_CACHE_CHECK(for -fpie, libc_cv_fpie, [dnl
diff --git a/libc/conform/data/cpio.h-data b/libc/conform/data/cpio.h-data
index 472777069..ac7d40fd5 100644
--- a/libc/conform/data/cpio.h-data
+++ b/libc/conform/data/cpio.h-data
@@ -1,4 +1,4 @@
-#if !defined ISO && !defined ISO99 && !defined ISO11
+#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX
constant C_IRUSR == 0000400
constant C_IWUSR == 0000200
constant C_IXUSR == 0000100
diff --git a/libc/conform/data/errno.h-data b/libc/conform/data/errno.h-data
index eaf6c210e..12730ba97 100644
--- a/libc/conform/data/errno.h-data
+++ b/libc/conform/data/errno.h-data
@@ -10,78 +10,116 @@ allow errno
#if !defined ISO && !defined ISO99 && !defined ISO11
macro-int-constant E2BIG {int} > 0
macro-int-constant EACCES {int} > 0
+# if !defined POSIX
macro-int-constant EADDRINUSE {int} > 0
macro-int-constant EADDRNOTAVAIL {int} > 0
macro-int-constant EAFNOSUPPORT {int} > 0
+# endif
macro-int-constant EAGAIN {int} > 0
+# if !defined POSIX
macro-int-constant EALREADY {int} > 0
+# endif
macro-int-constant EBADF {int} > 0
macro-int-constant EBADMSG {int} > 0
macro-int-constant EBUSY {int} > 0
macro-int-constant ECANCELED {int} > 0
macro-int-constant ECHILD {int} > 0
+# if !defined POSIX
macro-int-constant ECONNABORTED {int} > 0
macro-int-constant ECONNREFUSED {int} > 0
macro-int-constant ECONNRESET {int} > 0
+# endif
macro-int-constant EDEADLK {int} > 0
+# if !defined POSIX
macro-int-constant EDESTADDRREQ {int} > 0
macro-int-constant EDQUOT {int} > 0
+# endif
macro-int-constant EEXIST {int} > 0
macro-int-constant EFAULT {int} > 0
macro-int-constant EFBIG {int} > 0
+# if !defined POSIX
macro-int-constant EHOSTUNREACH {int} > 0
macro-int-constant EIDRM {int} > 0
+# endif
macro-int-constant EINPROGRESS {int} > 0
macro-int-constant EINTR {int} > 0
macro-int-constant EINVAL {int} > 0
macro-int-constant EIO {int} > 0
+# if !defined POSIX
macro-int-constant EISCONN {int} > 0
+# endif
macro-int-constant EISDIR {int} > 0
+# if !defined POSIX
macro-int-constant ELOOP {int} > 0
+# endif
macro-int-constant EMFILE {int} > 0
macro-int-constant EMLINK {int} > 0
macro-int-constant EMSGSIZE {int} > 0
+# if !defined POSIX
macro-int-constant EMULTIHOP {int} > 0
+# endif
macro-int-constant ENAMETOOLONG {int} > 0
+# if !defined POSIX
macro-int-constant ENETDOWN {int} > 0
macro-int-constant ENETUNREACH {int} > 0
+# endif
macro-int-constant ENFILE {int} > 0
+# if !defined POSIX
macro-int-constant ENOBUFS {int} > 0
macro-int-constant ENODATA {int} > 0
+# endif
macro-int-constant ENODEV {int} > 0
macro-int-constant ENOENT {int} > 0
macro-int-constant ENOEXEC {int} > 0
macro-int-constant ENOLCK {int} > 0
+# if !defined POSIX
macro-int-constant ENOLINK {int} > 0
+# endif
macro-int-constant ENOMEM {int} > 0
+# if !defined POSIX
macro-int-constant ENOMSG {int} > 0
macro-int-constant ENOPROTOOPT {int} > 0
+# endif
macro-int-constant ENOSPC {int} > 0
+# if !defined POSIX
macro-int-constant ENOSR {int} > 0
macro-int-constant ENOSTR {int} > 0
+# endif
macro-int-constant ENOSYS {int} > 0
+# if !defined POSIX
macro-int-constant ENOTCONN {int} > 0
+# endif
macro-int-constant ENOTDIR {int} > 0
macro-int-constant ENOTEMPTY {int} > 0
+# if !defined POSIX
macro-int-constant ENOTSOCK {int} > 0
+# endif
macro-int-constant ENOTSUP {int} > 0
macro-int-constant ENOTTY {int} > 0
macro-int-constant ENXIO {int} > 0
+# if !defined POSIX
macro-int-constant EOPNOTSUPP {int} > 0
macro-int-constant EOVERFLOW {int} > 0
+# endif
macro-int-constant EPERM {int} > 0
macro-int-constant EPIPE {int} > 0
+# if !defined POSIX
macro-int-constant EPROTO {int} > 0
macro-int-constant EPROTONOSUPPORT {int} > 0
macro-int-constant EPROTOTYPE {int} > 0
+# endif
macro-int-constant EROFS {int} > 0
macro-int-constant ESPIPE {int} > 0
macro-int-constant ESRCH {int} > 0
+# if !defined POSIX
macro-int-constant ESTALE {int} > 0
macro-int-constant ETIME {int} > 0
+# endif
macro-int-constant ETIMEDOUT {int} > 0
+# if !defined POSIX
macro-int-constant ETXTBSY {int} > 0
macro-int-constant EWOULDBLOCK {int} > 0
+# endif
macro-int-constant EXDEV {int} > 0
# if defined XOPEN2K8 || defined POSIX2008
@@ -89,7 +127,6 @@ macro-int-constant ENOTRECOVERABLE {int} > 0
macro-int-constant EOWNERDEAD {int} > 0
# endif
-allow E*
allow *_t
#endif
diff --git a/libc/conform/data/fcntl.h-data b/libc/conform/data/fcntl.h-data
index 46892488b..efe134e44 100644
--- a/libc/conform/data/fcntl.h-data
+++ b/libc/conform/data/fcntl.h-data
@@ -18,7 +18,11 @@ constant F_RDLCK
constant F_UNLCK
constant F_WRLCK
-#if !defined POSIX
+#if defined POSIX
+allow SEEK_SET
+allow SEEK_CUR
+allow SEEK_END
+#else
constant SEEK_SET
constant SEEK_CUR
constant SEEK_END
@@ -30,10 +34,12 @@ constant O_NOCTTY
constant O_TRUNC
constant O_APPEND
-constant O_DSYNC
constant O_NONBLOCK
-constant O_RSYNC
constant O_SYNC
+#if !defined XPG3 && !defined XPG4
+constant O_DSYNC
+constant O_RSYNC
+#endif
constant O_ACCMODE
@@ -87,9 +93,13 @@ element {struct flock} off_t l_start
element {struct flock} off_t l_len
element {struct flock} pid_t l_pid
+#if !defined POSIX
+# if !defined UNIX98
type mode_t
+# endif
type off_t
type pid_t
+#endif
function int creat (const char*, mode_t)
function int fcntl (int, int, ...)
@@ -119,16 +129,14 @@ constant AT_REMOVEDIR
function int openat(int, const char*, int, ...)
#endif
+#if !defined POSIX
allow-header sys/stat.h
allow-header unistd.h
+#endif
allow l_*
allow F_*
allow O_*
allow S_*
allow *_t
-
-allow timespec
-allow tv_nsec
-allow tv_sec
#endif
diff --git a/libc/conform/data/glob.h-data b/libc/conform/data/glob.h-data
index fc2c7febf..eca83937a 100644
--- a/libc/conform/data/glob.h-data
+++ b/libc/conform/data/glob.h-data
@@ -19,7 +19,7 @@ constant GLOB_NOSORT
constant GLOB_ABORTED
constant GLOB_NOMATCH
constant GLOB_NOSPACE
-# if !defined XOPEN2K8 && !defined POSIX2008
+# if !defined XOPEN2K8 && !defined POSIX2008 && !defined POSIX
constant GLOB_NOSYS
# endif
diff --git a/libc/conform/data/limits.h-data b/libc/conform/data/limits.h-data
index dec178a51..726db1e63 100644
--- a/libc/conform/data/limits.h-data
+++ b/libc/conform/data/limits.h-data
@@ -28,16 +28,21 @@ macro-int-constant ULLONG_MAX {unsigned long long int} >= 18446744073709551615ul
#if !defined ISO && !defined ISO99 && !defined ISO11
// if these values exist, we should check the minimal value
-allow AIO_LIST_MAX
+allow AIO_LISTIO_MAX
allow AIO_MAX
allow AIO_PRIO_DELTA_MAX
allow ARG_MAX
-allow ATEXT_MAX
+#if !defined POSIX && !defined XPG3
+allow ATEXIT_MAX
+#endif
allow CHILD_MAX
allow DELAYTIMER_MAX
+#if !defined POSIX && !defined POSIX2008 && !defined XPG3
allow IOV_MAX
+#endif
allow LOGIN_NAME_MAX
allow MQ_OPEN_MAX
+allow MQ_PRIO_MAX
allow OPEN_MAX
allow PAGESIZE
#if !defined POSIX && !defined POSIX2008
@@ -47,98 +52,117 @@ allow PTHREAD_DESTRUCTOR_ITERATIONS
allow PTHREAD_KEYS_MAX
allow PTHREAD_STACK_MIN
allow PTHREAD_THREADS_MAX
-allow RE_DUP_MAX
allow RTSIG_MAX
allow SEM_NSEMS_MAX
allow SEM_VALUE_MAX
allow SIGQUEUE_MAX
+#if !defined POSIX && !defined XPG3 && !defined XPG4 && !defined UNIX98
allow SS_REPL_MAX
+#endif
allow STREAM_MAX
+#if !defined POSIX && !defined XPG3 && !defined XPG4 && !defined UNIX98
allow SYMLOOP_MAX
+#endif
allow TIMER_MAX
allow TTY_NAME_MAX
allow TZNAME_MAX
+#if !defined POSIX && !defined XPG3 && !defined XPG4
allow FILESIZEBITS
+#endif
allow LINK_MAX
allow MAX_CANON
allow MAX_INPUT
allow NAME_MAX
allow PATH_MAX
allow PIPE_BUF
+#if !defined POSIX && !defined XPG3 && !defined XPG4 && !defined UNIX98
allow POSIX_ALLOC_SIZE_MIN
allow POSIX_REC_INCR_XFER_SIZE
allow POSIX_REC_MAX_XFER_SIZE
allow POSIX_REC_XFER_ALIGN
allow SYMLINK_MAX
+#endif
-macro BC_BASE_MAX
-macro BC_DIM_MAX
-macro BC_SCALE_MAX
-macro BC_STRING_MAX
+macro-constant BC_BASE_MAX >= _POSIX2_BC_BASE_MAX
+macro-constant BC_DIM_MAX >= _POSIX2_BC_DIM_MAX
+macro-constant BC_SCALE_MAX >= _POSIX2_BC_SCALE_MAX
+macro-constant BC_STRING_MAX >= _POSIX2_BC_STRING_MAX
+#if !defined POSIX && !defined XPG3 && !defined XPG4
macro CHARCLASS_NAME_MAX
-macro COLL_WEIGHTS_MAX
-macro EXPR_NEST_MAX
-macro LINE_MAX
+#endif
+macro-constant COLL_WEIGHTS_MAX >= _POSIX2_COLL_WEIGHTS_MAX
+macro-constant EXPR_NEST_MAX >= _POSIX2_EXPR_NEST_MAX
+macro-constant LINE_MAX >= _POSIX2_LINE_MAX
constant NGROUPS_MAX >= 8
-macro RE_DUP_MAX
+macro-constant RE_DUP_MAX >= _POSIX2_RE_DUP_MAX
-constant _POSIX_CLOCKRES_MIN <= 20000000
+constant _POSIX_CLOCKRES_MIN == 20000000
-optional-constant _POSIX_AIO_LISTIO_MAX == 2
-optional-constant _POSIX_AIO_MAX == 1
-optional-constant _POSIX_ARG_MAX == 4096
+constant _POSIX_AIO_LISTIO_MAX == 2
+constant _POSIX_AIO_MAX == 1
+constant _POSIX_ARG_MAX == 4096
#if !defined POSIX && !defined XPG3 && !defined XPG4 && !defined UNIX98
-optional-constant _POSIX_CHILD_MAX == 25
+constant _POSIX_CHILD_MAX == 25
#else
-optional-constant _POSIX_CHILD_MAX == 6
-#endif
-optional-constant _POSIX_DELAYTIMER_MAX == 32
-optional-constant _POSIX_LINK_MAX == 8
-optional-constant _POSIX_LOGIN_NAME_MAX == 9
-optional-constant _POSIX_MAX_CANON == 255
-optional-constant _POSIX_MAX_INPUT == 255
-optional-constant _POSIX_MQ_OPEN_MAX == 8
-optional-constant _POSIX_MQ_PRIO_MAX == 32
-optional-constant _POSIX_NAME_MAX == 14
+constant _POSIX_CHILD_MAX == 6
+#endif
+constant _POSIX_DELAYTIMER_MAX == 32
+constant _POSIX_LINK_MAX == 8
+constant _POSIX_LOGIN_NAME_MAX == 9
+constant _POSIX_MAX_CANON == 255
+constant _POSIX_MAX_INPUT == 255
+constant _POSIX_MQ_OPEN_MAX == 8
+constant _POSIX_MQ_PRIO_MAX == 32
+constant _POSIX_NAME_MAX == 14
#if !defined POSIX && !defined XPG3 && !defined XPG4 && !defined UNIX98
-optional-constant _POSIX_NGROUPS_MAX == 8
+constant _POSIX_NGROUPS_MAX == 8
#else
-optional-constant _POSIX_NGROUPS_MAX == 0
+constant _POSIX_NGROUPS_MAX == 0
#endif
#if !defined POSIX && !defined XPG3 && !defined XPG4 && !defined UNIX98
-optional-constant _POSIX_OPEN_MAX == 20
+constant _POSIX_OPEN_MAX == 20
#else
-optional-constant _POSIX_OPEN_MAX == 16
-#endif
-optional-constant _POSIX_PATH_MAX == 256
-optional-constant _POSIX_PIPE_BUF == 512
-optional-constant _POSIX2_RE_DUP_MAX == 255
-optional-constant _POSIX_RTSIG_MAX == 8
-optional-constant _POSIX_SEM_NSEMS_MAX == 256
-optional-constant _POSIX_SEM_VALUE_MAX == 32767
-optional-constant _POSIX_SIGQUEUE_MAX == 32
-optional-constant _POSIX_SSIZE_MAX == 32767
-optional-constant _POSIX_STREAM_MAX == 8
+constant _POSIX_OPEN_MAX == 16
+#endif
+// Value was 255, corrected to 256 following an interpretation request.
+constant _POSIX_PATH_MAX == 256
+constant _POSIX_PIPE_BUF == 512
+constant _POSIX_RTSIG_MAX == 8
+constant _POSIX_SEM_NSEMS_MAX == 256
+constant _POSIX_SEM_VALUE_MAX == 32767
+constant _POSIX_SIGQUEUE_MAX == 32
+constant _POSIX_SSIZE_MAX == 32767
+constant _POSIX_STREAM_MAX == 8
+#if !defined POSIX && !defined XPG3 && !defined XPG4 && !defined UNIX98
optional-constant _POSIX_SS_REPL_MAX == 4
optional-constant _POSIX_SYMLINK_MAX == 255
optional-constant _POSIX_SYMLOOP_MAX == 8
-optional-constant _POSIX_THREAD_DESTRUCTOR_ITERATIONS == 4
-optional-constant _POSIX_THREAD_KEYS_MAX == 128
-optional-constant _POSIX_THREAD_THREADS_MAX == 64
-optional-constant _POSIX_TIMER_MAX == 32
-optional-constant _POSIX_TTY_NAME_MAX == 9
-optional-constant _POSIX_TZNAME_MAX == 6
-optional-constant _POSIX2_BC_BASE_MAX == 99
-optional-constant _POSIX2_BC_DIM_MAX == 2048
-optional-constant _POSIX2_BC_SCALE_MAX == 99
-optional-constant _POSIX2_BC_STRING_MAX == 1000
-optional-constant _POSIX2_CHARCLASS_NAME_MAX == 14
-optional-constant _POSIX2_COLL_WEIGHTS_MAX == 2
-optional-constant _POSIX2_EXPR_NEST_MAX == 32
-optional-constant _POSIX2_LINE_MAX == 2048
-optional-constant _POSIX2_RE_DUP_MAX == 255
+#endif
+constant _POSIX_THREAD_DESTRUCTOR_ITERATIONS == 4
+constant _POSIX_THREAD_KEYS_MAX == 128
+constant _POSIX_THREAD_THREADS_MAX == 64
+constant _POSIX_TIMER_MAX == 32
+constant _POSIX_TTY_NAME_MAX == 9
+#if !defined POSIX && !defined XPG3 && !defined XPG4 && !defined UNIX98
+constant _POSIX_TZNAME_MAX == 6
+#else
+constant _POSIX_TZNAME_MAX == 3
+#endif
+macro-constant _POSIX2_BC_BASE_MAX == 99
+macro-constant _POSIX2_BC_DIM_MAX == 2048
+macro-constant _POSIX2_BC_SCALE_MAX == 99
+macro-constant _POSIX2_BC_STRING_MAX == 1000
+#if !defined POSIX && !defined XPG3 && !defined XPG4 && !defined UNIX98
+constant _POSIX2_CHARCLASS_NAME_MAX == 14
+#endif
+macro-constant _POSIX2_COLL_WEIGHTS_MAX == 2
+macro-constant _POSIX2_EXPR_NEST_MAX == 32
+macro-constant _POSIX2_LINE_MAX == 2048
+macro-constant _POSIX2_RE_DUP_MAX == 255
+#if !defined POSIX && !defined POSIX2008 && !defined XPG3
optional-constant _XOPEN_IOV_MAX == 16
+#endif
#if !defined POSIX && !defined POSIX2008
constant WORD_BIT >= 16
@@ -146,22 +170,31 @@ constant LONG_BIT >= 32
#endif
constant SSIZE_MAX
+#if !defined POSIX && !defined XPG3 && !defined XPG4
optional-constant CHARCLASS_NAME_MAX >= 14
+#endif
+#if !defined POSIX && !defined XPG3
optional-constant NL_ARGMAX >= 9
-#if !defined POSIX && !defined POSIX2008
+# if !defined POSIX2008
optional-constant NL_LANGMAX >= 14
-#endif
+# endif
optional-constant NL_MSGMAX >= 32767
-#if !defined XOPEN2K8 && !defined POSIX2008
+# if !defined XOPEN2K8 && !defined POSIX2008
optional-constant NL_NMAX
-#endif
+# endif
optional-constant NL_SETMAX >= 255
optional-constant NL_TEXTMAX
-#if !defined POSIX && !defined POSIX2008
+# if !defined POSIX2008
optional-constant NZERO >= 20
+# endif
#endif
+#if defined XPG4 || defined UNIX98
optional-constant TMP_MAX >= 10000
+#endif
allow *_MAX
+#if !defined POSIX && !defined XPG3 && !defined XPG4 && !defined UNIX98
allow *_MIN
#endif
+allow *_t
+#endif
diff --git a/libc/conform/data/locale.h-data b/libc/conform/data/locale.h-data
index adcd25f65..003e6cace 100644
--- a/libc/conform/data/locale.h-data
+++ b/libc/conform/data/locale.h-data
@@ -31,7 +31,7 @@ macro-constant NULL == 0
macro-int-constant LC_ALL
macro-int-constant LC_COLLATE
macro-int-constant LC_CTYPE
-#if !defined ISO && !defined ISO99 && !defined ISO11
+#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX
macro-int-constant LC_MESSAGES
#endif
macro-int-constant LC_MONETARY
diff --git a/libc/conform/data/mqueue.h-data b/libc/conform/data/mqueue.h-data
index d6313b3c5..2ff27480e 100644
--- a/libc/conform/data/mqueue.h-data
+++ b/libc/conform/data/mqueue.h-data
@@ -3,6 +3,11 @@
type mqd_t
type {struct sigevent}
+element {struct sigevent} int sigev_notify
+element {struct sigevent} int sigev_signo
+element {struct sigevent} {union sigval} sigev_value
+element {struct sigevent} {void(*} sigev_notify_function )(union sigval)
+element {struct sigevent} {pthread_attr_t*} sigev_notify_attributes
type {struct mq_attr}
element {struct mq_attr} long mq_flags
@@ -28,7 +33,6 @@ type pthread_attr_t
type size_t
type ssize_t
type {struct timespec}
-type {struct sigevent}
#endif
allow-header fcntl.h
@@ -36,5 +40,7 @@ allow-header signal.h
allow-header sys/types.h
allow-header time.h
+allow mq_*
+allow MQ_*
allow *_t
#endif
diff --git a/libc/conform/data/regex.h-data b/libc/conform/data/regex.h-data
index 2822f0b39..04f9034f8 100644
--- a/libc/conform/data/regex.h-data
+++ b/libc/conform/data/regex.h-data
@@ -26,6 +26,7 @@ constant REG_EBRACK
constant REG_EPAREN
constant REG_EBRACE
constant REG_BADBR
+constant REG_ERANGE
constant REG_ESPACE
constant REG_BADRPT
# if !defined POSIX && !defined XOPEN2K8 && !defined POSIX2008
diff --git a/libc/conform/data/signal.h-data b/libc/conform/data/signal.h-data
index ba9019b62..bb3784ad7 100644
--- a/libc/conform/data/signal.h-data
+++ b/libc/conform/data/signal.h-data
@@ -203,8 +203,10 @@ function int kill (pid_t, int)
# if !defined POSIX && !defined POSIX2008
function int killpg (pid_t, int)
# endif
+# if !defined XPG3 && !defined XPG4
function int pthread_kill (pthread_t, int)
function int pthread_sigmask (int, const sigset_t*, sigset_t*)
+# endif
function int sigaction (int, const struct sigaction*, struct sigaction*)
function int sigaddset (sigset_t*, int)
# if !defined POSIX && !defined POSIX2008
@@ -224,7 +226,9 @@ function int sigpause (int)
# endif
function int sigpending (sigset_t*)
function int sigprocmask (int, const sigset_t*, sigset_t*)
+# if !defined XPG3 && !defined XPG4
function int sigqueue (pid_t, int, const union sigval)
+# endif
# if !defined POSIX && !defined POSIX2008
function int sigrelse (int)
function void (*sigset (int, void(*)(int)))(int)
@@ -233,9 +237,13 @@ function void (*sigset (int, void(*)(int)))(int)
function int sigstack (struct sigstack*, struct sigstack*)
# endif
function int sigsuspend (const sigset_t*)
+# if !defined XPG3 && !defined XPG4
function int sigtimedwait (const sigset_t*, siginfo_t*, const struct timespec*)
+# endif
function int sigwait (const sigset_t*, int*)
+# if !defined XPG3 && !defined XPG4
function int sigwaitinfo (const sigset_t*, siginfo_t*)
+# endif
# if defined XOPEN2K8 || defined POSIX2008
function void psiginfo (const siginfo_t*, const char*)
function void psignal (int, const char*)
diff --git a/libc/conform/data/stdio.h-data b/libc/conform/data/stdio.h-data
index 816cf9ea2..9089180a1 100644
--- a/libc/conform/data/stdio.h-data
+++ b/libc/conform/data/stdio.h-data
@@ -9,7 +9,11 @@ macro-int-constant _IONBF
#if !defined ISO && !defined ISO99 && !defined ISO11
constant L_ctermid
# if !defined XOPEN2K && !defined XOPEN2K8 && !defined POSIX2008
+# ifdef POSIX
+optional-constant L_cuserid
+# else
constant L_cuserid
+# endif
# endif
#endif
macro-int-constant L_tmpnam
@@ -99,7 +103,7 @@ function int getc (FILE*)
function int getchar (void)
#if defined POSIX || defined XOPEN2K || defined XOPEN2K8 || defined POSIX2008
function int getc_unlocked (FILE*)
-function int getchar_unlocked ()
+function int getchar_unlocked (void)
#endif
#if defined XOPEN2K8 || defined POSIX2008
function ssize_t getdelim (char**, size_t*, int, FILE*)
@@ -144,7 +148,7 @@ function void rewind (FILE*)
function int scanf (const char*, ...)
function void setbuf (FILE*, char*)
function int setvbuf (FILE*, char*, int, size_t)
-#if !defined ISO && !defined POSIX
+#if !defined ISO && !defined POSIX && !defined XPG3 && !defined XPG4
function int snprintf (char*, size_t, const char*, ...)
#endif
function int sprintf (char *, const char *, ...)
@@ -166,7 +170,7 @@ function int vprintf (const char*, va_list)
#if !defined ISO && !defined POSIX && !defined XPG3 && !defined XPG4 && !defined UNIX98
function int vscanf (const char*, va_list)
#endif
-#if !defined ISO && !defined POSIX
+#if !defined ISO && !defined POSIX && !defined XPG3 && !defined XPG4
function int vsnprintf (char*, size_t, const char*, va_list)
#endif
function int vsprintf (char*, const char*, va_list)
@@ -174,15 +178,17 @@ function int vsprintf (char*, const char*, va_list)
function int vsscanf (const char*, const char*, va_list)
#endif
-#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX
-#if !defined XOPEN2K && !defined XOPEN2K8 && !defined POSIX2008
+#if !defined ISO && !defined ISO99 && !defined ISO11
+#if !defined POSIX && !defined XOPEN2K && !defined XOPEN2K8 && !defined POSIX2008
variable {char*} optarg
variable int opterr
variable int optind
variable int optopt
#endif
+#if !defined POSIX
allow-header stddef.h
+#endif
allow *_t
#endif
diff --git a/libc/conform/data/sys/stat.h-data b/libc/conform/data/sys/stat.h-data
index 2a5c3bf34..41c3932b6 100644
--- a/libc/conform/data/sys/stat.h-data
+++ b/libc/conform/data/sys/stat.h-data
@@ -1,6 +1,6 @@
#if !defined ISO && !defined ISO99 && !defined ISO11
-#if !defined POSIX && !defined POSIX2008
+#if !defined POSIX && !defined POSIX2008 && !defined XPG3 && !defined XPG4
type blkcnt_t
type blksize_t
#endif
diff --git a/libc/conform/data/sys/times.h-data b/libc/conform/data/sys/times.h-data
index d10444d35..c93357b79 100644
--- a/libc/conform/data/sys/times.h-data
+++ b/libc/conform/data/sys/times.h-data
@@ -1,4 +1,4 @@
-#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX
+#if !defined ISO && !defined ISO99 && !defined ISO11
type {struct tms}
element {struct tms} clock_t tms_utime
diff --git a/libc/conform/data/time.h-data b/libc/conform/data/time.h-data
index 9b346c39e..fead998d3 100644
--- a/libc/conform/data/time.h-data
+++ b/libc/conform/data/time.h-data
@@ -5,7 +5,7 @@ macro CLOCKS_PER_SEC {clock_t}
macro-int-constant TIME_UTC > 0
#endif
-#if !defined ISO && !defined ISO99
+#if !defined ISO && !defined ISO99 && !defined XPG3 && !defined XPG4
type {struct timespec}
element {struct timespec} time_t tv_sec
@@ -45,6 +45,7 @@ function int timespec_get (struct timespec *, int)
# if !defined XOPEN2K && !defined XOPEN2K8 && !defined POSIX2008
symbol CLK_TCK
# endif
+# if !defined XPG3 && !defined XPG4
constant CLOCK_PROCESS_CPUTIME_ID
constant CLOCK_THREAD_CPUTIME_ID
@@ -59,6 +60,7 @@ constant CLOCK_MONOTONIC
type clockid_t
type timer_t
+# endif
# if defined XOPEN2K8 || defined POSIX2008
type pid_t
@@ -74,30 +76,38 @@ function {char*} asctime_r (const struct tm*, char*)
#if !defined POSIX && !defined XPG3 && !defined XPG4 && !defined UNIX98
function int clock_getcpuclockid (pid_t, clockid_t*)
#endif
+#if !defined XPG3 && !defined XPG4
function int clock_getres (clockid_t, struct timespec*)
function int clock_gettime (clockid_t, struct timespec*)
+#endif
#if !defined POSIX && !defined XPG3 && !defined XPG4 && !defined UNIX98
function int clock_nanosleep (clockid_t, int, const struct timespec*, struct timespec*)
#endif
+#if !defined XPG3 && !defined XPG4
function int clock_settime (clockid_t, const struct timespec*)
+#endif
function {char*} ctime_r (const time_t*, char*)
# if !defined POSIX && !defined POSIX2008
function {struct tm*} getdate (const char*)
# endif
function {struct tm*} gmtime_r (const time_t*, struct tm*)
function {struct tm*} localtime_r (const time_t*, struct tm*)
+# if !defined XPG3 && !defined XPG4
function int nanosleep (const struct timespec*, struct timespec*)
+# endif
# if defined XOPEN2K8 || defined POSIX2008
function size_t strftime_l (char*, size_t, const char*, const struct tm*, locale_t)
# endif
# if !defined POSIX && !defined POSIX2008
function {char*} strptime (const char*, const char*, struct tm*)
# endif
+# if !defined XPG3 && !defined XPG4
function int timer_create (clockid_t, struct sigevent*, timer_t*)
function int timer_delete (timer_t)
function int timer_gettime (timer_t, struct itimerspec*)
function int timer_getoverrun (timer_t)
function int timer_settime (timer_t, int, const struct itimerspec*, struct itimerspec*)
+# endif
function void tzset (void)
# if !defined POSIX && !defined POSIX2008
diff --git a/libc/conform/data/unistd.h-data b/libc/conform/data/unistd.h-data
index 18bea5ee2..f8cd02eb6 100644
--- a/libc/conform/data/unistd.h-data
+++ b/libc/conform/data/unistd.h-data
@@ -392,7 +392,9 @@ function int fchownat (int, const char*, uid_t, gid_t, int)
#ifndef POSIX
function int fchdir (int)
#endif
+#if !defined XPG3 && !defined XPG4
function int fdatasync (int)
+#endif
# if defined XOPEN2K8 || defined POSIX2008
function int fexecve (int, char *const[], char *const[])
# endif
@@ -415,7 +417,9 @@ function long gethostid (void)
function int gethostname (char*, size_t)
#endif
function {char*} getlogin (void)
+#if !defined XPG3 && !defined XPG4
function int getlogin_r (char*, size_t)
+#endif
function int getopt (int, char*const[], const char*)
#if defined XPG3 || defined XPG4 || defined UNIX98
function int getpagesize (void)
@@ -452,13 +456,13 @@ function int nice (int)
function {long int} pathconf (const char*, int)
function int pause (void)
function int pipe (int[2])
-#ifndef POSIX
+#if !defined POSIX && !defined XPG3 && !defined XPG4
function ssize_t pread (int, void*, size_t, off_t)
#endif
-#if !defined POSIX && !defined XOPEN2K && !defined XOPEN2K8 && !defined POSIX2008
+#if !defined POSIX && !defined XOPEN2K && !defined XOPEN2K8 && !defined POSIX2008 && !defined XPG3 && !defined XPG4
function int pthread_atfork (void(*)(void), void(*)(void), void(*)(void))
#endif
-#ifndef POSIX
+#if !defined POSIX && !defined XPG3 && !defined XPG4
function ssize_t pwrite (int, const void*, size_t, off_t)
#endif
function ssize_t read (int, void*, size_t)
diff --git a/libc/conform/data/wordexp.h-data b/libc/conform/data/wordexp.h-data
index 821784a7f..0d96d68ed 100644
--- a/libc/conform/data/wordexp.h-data
+++ b/libc/conform/data/wordexp.h-data
@@ -13,6 +13,7 @@ constant WRDE_SHOWERR
constant WRDE_UNDEF
constant WRDE_BADCHAR
+constant WRDE_BADVAL
constant WRDE_CMDSUB
constant WRDE_NOSPACE
# if !defined POSIX && !defined XOPEN2K8 && !defined POSIX2008
diff --git a/libc/debug/test-strcpy_chk.c b/libc/debug/test-strcpy_chk.c
index fb9bc78d4..41eb354fa 100644
--- a/libc/debug/test-strcpy_chk.c
+++ b/libc/debug/test-strcpy_chk.c
@@ -23,6 +23,9 @@
# define TEST_NAME "strcpy_chk"
# include "../string/test-string.h"
+/* This test case implicitly tests the availability of the __chk_fail
+ symbol, which is part of the public ABI and may be used
+ externally. */
extern void __attribute__ ((noreturn)) __chk_fail (void);
char *simple_strcpy_chk (char *, const char *, size_t);
extern char *normal_strcpy (char *, const char *, size_t)
diff --git a/libc/elf/Makefile b/libc/elf/Makefile
index be9456bf7..41eebcf08 100644
--- a/libc/elf/Makefile
+++ b/libc/elf/Makefile
@@ -336,7 +336,7 @@ $(objpfx)ld.so: $(objpfx)librtld.os $(ld-map)
$(filter-out $(map-file),$^) $(load-map-file) \
-Wl,-soname=$(rtld-installed-name) \
-Wl,-defsym=_begin=0
- readelf -s $@ \
+ $(READELF) -s $@ \
| $(AWK) '($$7 ~ /^UND(|EF)$$/ && $$1 != "0:" && $$4 != "REGISTER") { print; p=1 } END { exit p != 0 }'
# interp.c exists just to get this string into the libraries.
diff --git a/libc/elf/cache.c b/libc/elf/cache.c
index db8b9fa2f..f5ed370e7 100644
--- a/libc/elf/cache.c
+++ b/libc/elf/cache.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2003,2005,2006,2007,2011 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.
@@ -94,6 +94,12 @@ print_entry (const char *lib, int flag, unsigned int osversion,
case FLAG_X8664_LIBX32:
fputs (",x32", stdout);
break;
+ case FLAG_ARM_LIBHF:
+ fputs (",hard-float", stdout);
+ break;
+ case FLAG_AARCH64_LIB64:
+ fputs (",AArch64", stdout);
+ break;
case 0:
break;
default:
diff --git a/libc/elf/dl-load.c b/libc/elf/dl-load.c
index c66e68d8e..0fe664145 100644
--- a/libc/elf/dl-load.c
+++ b/libc/elf/dl-load.c
@@ -1351,7 +1351,8 @@ cannot allocate TLS data structures for initial thread");
&& ((size_t) (c->mapend - c->mapstart + c->mapoff)
>= header->e_phoff + header->e_phnum * sizeof (ElfW(Phdr))))
/* Found the program header in this segment. */
- l->l_phdr = (void *) (c->mapstart + header->e_phoff - c->mapoff);
+ l->l_phdr = (void *) (uintptr_t) (c->mapstart + header->e_phoff
+ - c->mapoff);
if (c->allocend > c->dataend)
{
diff --git a/libc/elf/elf.h b/libc/elf/elf.h
index 1effa0710..b07e6ad93 100644
--- a/libc/elf/elf.h
+++ b/libc/elf/elf.h
@@ -798,6 +798,15 @@ typedef struct
#define DF_1_ENDFILTEE 0x00004000 /* Filtee terminates filters search. */
#define DF_1_DISPRELDNE 0x00008000 /* Disp reloc applied at build time. */
#define DF_1_DISPRELPND 0x00010000 /* Disp reloc applied at run-time. */
+#define DF_1_NODIRECT 0x00020000 /* Object has no-direct binding. */
+#define DF_1_IGNMULDEF 0x00040000
+#define DF_1_NOKSYMS 0x00080000
+#define DF_1_NOHDR 0x00100000
+#define DF_1_EDITED 0x00200000 /* Object is modified after built. */
+#define DF_1_NORELOC 0x00400000
+#define DF_1_SYMINTPOSE 0x00800000 /* Object has individual interposers. */
+#define DF_1_GLOBAUDIT 0x01000000 /* Global auditin required. */
+#define DF_1_SINGLETON 0x02000000 /* Singleton symbols are used. */
/* Flags for the feature selection in DT_FEATURE_1. */
#define DTF_1_PARINIT 0x00000001
diff --git a/libc/elf/get-dynamic-info.h b/libc/elf/get-dynamic-info.h
index ffac75f63..026f24623 100644
--- a/libc/elf/get-dynamic-info.h
+++ b/libc/elf/get-dynamic-info.h
@@ -151,6 +151,17 @@ elf_get_dynamic_info (struct link_map *l, ElfW(Dyn) *temp)
{
l->l_flags_1 = info[VERSYMIDX (DT_FLAGS_1)]->d_un.d_val;
+ /* Only DT_1_SUPPORTED_MASK bits are supported, and we would like
+ to assert this, but we can't. Users have been setting
+ unsupported DF_1_* flags for a long time and glibc has ignored
+ them. Therefore to avoid breaking existing applications the
+ best we can do is add a warning during debugging with the
+ intent of notifying the user of the problem. */
+ if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_FILES, 0)
+ && l->l_flags_1 & ~DT_1_SUPPORTED_MASK)
+ _dl_debug_printf ("\nWARNING: Unsupported flag value(s) of 0x%x in DT_FLAGS_1.\n",
+ l->l_flags_1 & ~DT_1_SUPPORTED_MASK);
+
if (l->l_flags_1 & DF_1_NOW)
info[DT_BIND_NOW] = info[VERSYMIDX (DT_FLAGS_1)];
}
diff --git a/libc/elf/sotruss.ksh b/libc/elf/sotruss.ksh
index 587ab6898..8390b6c50 100755
--- a/libc/elf/sotruss.ksh
+++ b/libc/elf/sotruss.ksh
@@ -94,14 +94,14 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
do_missing_arg "$1"
fi
shift
- SOTRUSS_FROMLIST="$2"
+ SOTRUSS_FROMLIST="$1"
;;
-T | --t | --to)
if test $# -eq 1; then
do_missing_arg "$1"
fi
shift
- SOTRUSS_TOLIST="$2"
+ SOTRUSS_TOLIST="$1"
;;
-o | --o | --ou | --out | --outp | --outpu | --output)
if test $# -eq 1; then
diff --git a/libc/include/elf.h b/libc/include/elf.h
index cdedd8598..60658c617 100644
--- a/libc/include/elf.h
+++ b/libc/include/elf.h
@@ -3,4 +3,10 @@
/* Some information which is not meant for the public and therefore not
in <elf.h>. */
# include <dl-dtprocnum.h>
+# ifdef DT_1_SUPPORTED_MASK
+# error DT_1_SUPPORTED_MASK is defined!
+# endif
+# define DT_1_SUPPORTED_MASK \
+ (DF_1_NOW | DF_1_NODELETE | DF_1_INITFIRST | DF_1_NOOPEN \
+ | DF_1_ORIGIN | DF_1_NODEFLIB)
#endif
diff --git a/libc/include/libc-internal.h b/libc/include/libc-internal.h
index e5fd5337a..0c0fa024a 100644
--- a/libc/include/libc-internal.h
+++ b/libc/include/libc-internal.h
@@ -34,4 +34,20 @@ extern void __libc_thread_freeres (void);
/* Define and initialize `__progname' et. al. */
extern void __init_misc (int, char **, char **);
+/* 1 if 'type' is a pointer type, 0 otherwise. */
+# define __pointer_type(type) (__builtin_classify_type ((type) 0) == 5)
+
+/* __intptr_t if P is true, or T if P is false. */
+# define __integer_if_pointer_type_sub(T, P) \
+ __typeof__ (*(0 ? (__typeof__ (0 ? (T *) 0 : (void *) (P))) 0 \
+ : (__typeof__ (0 ? (__intptr_t *) 0 : (void *) (!(P)))) 0))
+
+/* __intptr_t if EXPR has a pointer type, or the type of EXPR otherwise. */
+# define __integer_if_pointer_type(expr) \
+ __integer_if_pointer_type_sub(__typeof__ ((__typeof__ (expr)) 0), \
+ __pointer_type (__typeof__ (expr)))
+
+/* Cast an integer or a pointer VAL to integer with proper type. */
+# define cast_to_integer(val) ((__integer_if_pointer_type (val)) (val))
+
#endif /* _LIBC_INTERNAL */
diff --git a/libc/include/rpc/svc.h b/libc/include/rpc/svc.h
index 141971ecf..61a8ab350 100644
--- a/libc/include/rpc/svc.h
+++ b/libc/include/rpc/svc.h
@@ -35,4 +35,6 @@ libc_hidden_proto (svcunixfd_create)
libc_hidden_proto (svc_getreq_common)
libc_hidden_proto (svc_getreq_poll)
+extern void __svc_accept_failed (void) attribute_hidden;
+
#endif
diff --git a/libc/include/sys/socket.h b/libc/include/sys/socket.h
index ec088572b..9caf1bbdf 100644
--- a/libc/include/sys/socket.h
+++ b/libc/include/sys/socket.h
@@ -91,6 +91,10 @@ extern ssize_t __libc_sendmsg (int __fd, const struct msghdr *__message,
extern ssize_t __sendmsg (int __fd, const struct msghdr *__message,
int __flags) attribute_hidden;
+extern int __sendmmsg (int __fd, struct mmsghdr *__vmessages,
+ unsigned int __vlen, int __flags);
+libc_hidden_proto (__sendmmsg)
+
/* Receive a message as described by MESSAGE from socket FD.
Returns the number of bytes read or -1 for errors. */
extern ssize_t __libc_recvmsg (int __fd, struct msghdr *__message,
diff --git a/libc/inet/tst-inet6_rth.c b/libc/inet/tst-inet6_rth.c
index 4c5c90ac0..549d717c7 100644
--- a/libc/inet/tst-inet6_rth.c
+++ b/libc/inet/tst-inet6_rth.c
@@ -66,20 +66,24 @@ inet6_rth_segments returned wrong value after loop with third inet6_rth_add");
goto out;
}
- char buf2[1000];
- if (inet6_rth_reverse (p, buf2) != 0)
+ union
+ {
+ char buffer[1000];
+ struct ip6_rthdr0 rthdr0;
+ } buf2;
+ if (inet6_rth_reverse (p, buf2.buffer) != 0)
{
puts ("first inet6_rth_reverse call failed");
res = 1;
goto out;
}
- if (((struct ip6_rthdr0 *) buf2)->ip6r0_segleft != nseg)
+ if (buf2.rthdr0.ip6r0_segleft != nseg)
{
puts ("segleft after first inet6_rth_reverse wrong");
res = 1;
}
- if (inet6_rth_segments (p) != inet6_rth_segments (buf2))
+ if (inet6_rth_segments (p) != inet6_rth_segments (buf2.buffer))
{
puts ("number of seconds after first inet6_rth_reverse differs");
res = 1;
@@ -88,7 +92,7 @@ inet6_rth_segments returned wrong value after loop with third inet6_rth_add");
for (int i = 0; i < nseg; ++i)
{
- struct in6_addr *addr = inet6_rth_getaddr (buf2, i);
+ struct in6_addr *addr = inet6_rth_getaddr (buf2.buffer, i);
if (addr == NULL)
{
printf ("call %d of first inet6_rth_getaddr failed\n",
diff --git a/libc/libio/Makefile b/libc/libio/Makefile
index f671b4d9c..a57cc655f 100644
--- a/libc/libio/Makefile
+++ b/libc/libio/Makefile
@@ -68,7 +68,7 @@ tests = test-fmemopen tst-ext tst-ext2 \
tst-mmap2-eofsync tst-mmap-offend bug-fopena+ \
bug-ungetc2 bug-ungetc3 bug-ungetc4 \
tst-memstream1 tst-memstream2 \
- bug-memstream1 tst-popen1 bug-fclose1
+ bug-memstream1 tst-popen1 bug-fclose1 tst-fwrite-error
tests-$(OPTION_EGLIBC_LOCALE_CODE) \
+= tst-swscanf tst-fgetws tst-setvbuf1 \
tst-ungetwc1 tst-ungetwc2 bug-ftell bug-ungetwc2 \
diff --git a/libc/libio/iofwrite.c b/libc/libio/iofwrite.c
index d4610f78c..2fff72b40 100644
--- a/libc/libio/iofwrite.c
+++ b/libc/libio/iofwrite.c
@@ -42,12 +42,12 @@ _IO_fwrite (buf, size, count, fp)
if (_IO_vtable_offset (fp) != 0 || _IO_fwide (fp, -1) == -1)
written = _IO_sputn (fp, (const char *) buf, request);
_IO_release_lock (fp);
- /* We have written all of the input in case the return value indicates
- this or EOF is returned. The latter is a special case where we
- simply did not manage to flush the buffer. But the data is in the
- buffer and therefore written as far as fwrite is concerned. */
- if (written == request || written == EOF)
+ /* We are guaranteed to have written all of the input, none of it, or
+ some of it. */
+ if (written == request)
return count;
+ else if (written == EOF)
+ return 0;
else
return written / size;
}
diff --git a/libc/libio/iofwrite_u.c b/libc/libio/iofwrite_u.c
index a1077eeb9..245a93ee0 100644
--- a/libc/libio/iofwrite_u.c
+++ b/libc/libio/iofwrite_u.c
@@ -44,12 +44,12 @@ fwrite_unlocked (buf, size, count, fp)
if (_IO_fwide (fp, -1) == -1)
{
written = _IO_sputn (fp, (const char *) buf, request);
- /* We have written all of the input in case the return value indicates
- this or EOF is returned. The latter is a special case where we
- simply did not manage to flush the buffer. But the data is in the
- buffer and therefore written as far as fwrite is concerned. */
- if (written == request || written == EOF)
+ /* We are guaranteed to have written all of the input, none of it, or
+ some of it. */
+ if (written == request)
return count;
+ else if (written == EOF)
+ return 0;
}
return written / size;
diff --git a/libc/libio/tst-fwrite-error.c b/libc/libio/tst-fwrite-error.c
new file mode 100644
index 000000000..3c0cf49c3
--- /dev/null
+++ b/libc/libio/tst-fwrite-error.c
@@ -0,0 +1,66 @@
+/* Test of fwrite() function, adapted from gnulib-tests in grep.
+ Copyright (C) 2011-2012 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+#include <errno.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <stdio.h>
+
+static int
+do_test (void)
+{
+ char tmpl[] = "/tmp/tst-fwrite-error.XXXXXX";
+ int fd = mkstemp (tmpl);
+ if (fd == -1)
+ {
+ printf ("mkstemp failed with errno %d\n", errno);
+ return 1;
+ }
+ FILE *fp = fdopen (fd, "w");
+ if (fp == NULL)
+ {
+ printf ("fdopen failed with errno %d\n", errno);
+ return 1;
+ }
+
+ char buf[5] = "world";
+ setvbuf (fp, NULL, _IONBF, 0);
+ close (fd);
+ unlink (tmpl);
+ errno = 0;
+
+ int ret = fwrite (buf, 1, sizeof (buf), fp);
+ if (ret != 0)
+ {
+ printf ("fwrite returned %d\n", ret);
+ return 1;
+ }
+ if (errno != EBADF)
+ {
+ printf ("Errno is not EBADF: %d\n", errno);
+ return 1;
+ }
+ if (ferror (fp) == 0)
+ {
+ printf ("ferror not set\n");
+ return 1;
+ }
+
+ return 0;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/libc/localedata/ChangeLog b/libc/localedata/ChangeLog
index c25554d71..a4dc29eb5 100644
--- a/libc/localedata/ChangeLog
+++ b/libc/localedata/ChangeLog
@@ -1,3 +1,37 @@
+2012-11-26 Nik Kalach <nikka@fedoraproject.org>
+
+ * locales/ia_FR (abmon): Fix December.
+
+ [BZ#14879]
+ * locales/ia_FR : New file.
+ * SUPPORTED (SUPPORTED-LOCALES): Add appropriate entry.
+
+2012-11-22 Andreas Jaeger <aj@suse.de>
+
+ * locales/niu_NU: Fix comment.
+
+2012-11-21 Andreas Jaeger <aj@suse.de>
+
+ * locales/szl_PL (LC_COLLATE): Fix syntax error.
+
+ * SUPPORTED (SUPPORTED-LOCALES): Fix typo for ayc_PE entry.
+
+2012-11-21 Chris Leonard <cjl@sugarlabs.org>
+
+ [BZ #14863]
+ * SUPPORTED: Add niu_NU and niu_NZ.
+ * locales/niu_NU: Add Niuean (Vagahau Niue) locale for Niue,
+ contributed by Chris Leonard <cjl@sugarlabs.org> and Emani
+ Fakaotimanava-Lui <emani@niue.nu>.
+ * locales/niu_NZ: Add Niuean (Vagahau Niue) locale for New
+ Zealand, contributed by Chris Leonard <cjl@sugarlabs.org> and Emani
+ Fakaotimanava-Lui <emani@niue.nu>.
+
+2012-11-19 Eagle Burkut <eagle.burkut@gmail.com>
+
+ [BZ #13759]
+ * locales/ug_CN (LC_COLLATE, LC_TIME, LC_MESSAGES): Fix entries.
+
2012-11-16 Andreas Jaeger <aj@suse.de>
[BZ #14368]
diff --git a/libc/localedata/SUPPORTED b/libc/localedata/SUPPORTED
index 240fbccc5..e2439302c 100644
--- a/libc/localedata/SUPPORTED
+++ b/libc/localedata/SUPPORTED
@@ -46,7 +46,7 @@ ar_TN.UTF-8/UTF-8 \
ar_TN/ISO-8859-6 \
ar_YE.UTF-8/UTF-8 \
ar_YE/ISO-8859-6 \
-ayc_PE/UFT-8 \
+ayc_PE/UTF-8 \
az_AZ/UTF-8 \
as_IN/UTF-8 \
ast_ES.UTF-8/UTF-8 \
@@ -242,6 +242,7 @@ hu_HU.UTF-8/UTF-8 \
hu_HU/ISO-8859-2 \
hy_AM/UTF-8 \
hy_AM.ARMSCII-8/ARMSCII-8 \
+ia_FR/UTF-8 \
id_ID.UTF-8/UTF-8 \
id_ID/ISO-8859-1 \
ig_NG/UTF-8 \
@@ -312,6 +313,8 @@ nds_DE/UTF-8 \
nds_NL/UTF-8 \
ne_NP/UTF-8 \
nhn_MX/UTF-8 \
+niu_NU/UTF-8 \
+niu_NZ/UTF-8 \
nl_AW/UTF-8 \
nl_BE.UTF-8/UTF-8 \
nl_BE/ISO-8859-1 \
diff --git a/libc/localedata/locales/ia_FR b/libc/localedata/locales/ia_FR
new file mode 100644
index 000000000..e31fc2275
--- /dev/null
+++ b/libc/localedata/locales/ia_FR
@@ -0,0 +1,140 @@
+comment_char %
+escape_char /
+%
+% Interlingua locale for France
+% Language: ia
+% Territory: FR
+% Revision: 1.0
+% Date: 2012-11-26
+% Application: general
+% Users: general
+% Charset: UTF-8
+
+LC_IDENTIFICATION
+title "Interlingua locale for France"
+source "Fedora Project"
+address ""
+contact "Nik Kalach"
+email "nikka@fedoraproject.org"
+tel ""
+fax ""
+language "Interlingua"
+territory "France"
+revision "1.0"
+date "2012-11-26"
+
+category ia_FR:2000;LC_IDENTIFICATION
+category ia_FR:2000;LC_CTYPE
+category ia_FR:2000;LC_COLLATE
+category ia_FR:2000;LC_TIME
+category ia_FR:2000;LC_NUMERIC
+category ia_FR:2000;LC_MONETARY
+category ia_FR:2000;LC_MESSAGES
+category ia_FR:2000;LC_MEASUREMENT
+category ia_FR:2000;LC_PAPER
+category ia_FR:2000;LC_NAME
+category ia_FR:2000;LC_ADDRESS
+category ia_FR:2000;LC_TELEPHONE
+
+END LC_IDENTIFICATION
+
+LC_CTYPE
+copy "fr_FR"
+END LC_CTYPE
+
+LC_COLLATE
+copy "fr_FR"
+END LC_COLLATE
+
+LC_TIME
+abday "<U0064><U006F><U006D>";"<U006C><U0075><U006E>";/
+ "<U006D><U0061><U0072>";"<U006D><U0065><U0072>";/
+ "<U006A><U006F><U0076>";"<U0076><U0065><U006E>";/
+ "<U0073><U0061><U0062>"
+day "<U0064><U006F><U006D><U0069><U006E><U0069><U0063><U0061>";/
+ "<U006C><U0075><U006E><U0065><U0064><U0069>";/
+ "<U006D><U0061><U0072><U0074><U0065><U0064><U0069>";/
+ "<U006D><U0065><U0072><U0063><U0075><U0072><U0069><U0064><U0069>";/
+ "<U006A><U006F><U0076><U0065><U0064><U0069>";/
+ "<U0076><U0065><U006E><U0065><U0072><U0064><U0069>";/
+ "<U0073><U0061><U0062><U0062><U0061><U0074><U006F>"
+abmon "<U006A><U0061><U006E>";"<U0066><U0065><U0062>";/
+ "<U006D><U0061><U0072>";"<U0061><U0070><U0072>";/
+ "<U006D><U0061><U0069>";"<U006A><U0075><U006E>";/
+ "<U006A><U0075><U006C>";"<U0061><U0075><U0067>";/
+ "<U0073><U0065><U0070>";"<U006F><U0063><U0074>";/
+ "<U006E><U006F><U0076>";"<U0064><U0065><U0063>"
+mon "<U006A><U0061><U006E><U0075><U0061><U0072><U0069><U006F>";/
+ "<U0066><U0065><U0062><U0072><U0075><U0061><U0072><U0069><U006F>";/
+ "<U006D><U0061><U0072><U0074><U0069><U006F>";/
+ "<U0061><U0070><U0072><U0069><U006C>";/
+ "<U006D><U0061><U0069><U006F>";/
+ "<U006A><U0075><U006E><U0069><U006F>";/
+ "<U006A><U0075><U006C><U0069><U006F>";/
+ "<U0061><U0075><U0067><U0075><U0073><U0074><U006F>";/
+ "<U0073><U0065><U0070><U0074><U0065><U006D><U0062><U0072><U0065>";/
+ "<U006F><U0063><U0074><U006F><U0062><U0072><U0065>";/
+ "<U006E><U006F><U0076><U0065><U006D><U0062><U0072><U0065>";/
+ "<U0064><U0065><U0063><U0065><U006D><U0062><U0072><U0065>"
+d_t_fmt "<U0025><U0061><U0020><U0025><U0064><U0020><U0025><U0062><U0020>/
+<U0025><U0059><U0020><U0025><U0054><U0020><U0025><U005A>"
+d_fmt "<U0025><U0064><U002E><U0025><U006D><U002E><U0025><U0059>"
+t_fmt "<U0025><U0054>"
+am_pm "<U0041><U004D>";"<U0050><U004D>"
+t_fmt_ampm ""
+date_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065>/
+<U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020>/
+<U0025><U005A><U0020><U0025><U0059>"
+week 7;19971130;4
+first_workday 2
+first_weekday 2
+END LC_TIME
+
+LC_NUMERIC
+copy "fr_FR"
+END LC_NUMERIC
+
+LC_MONETARY
+copy "fr_FR"
+END LC_MONETARY
+
+LC_MESSAGES
+yesexpr "<U005E><U005B><U0073><U0053><U0079><U0059><U005D><U002E><U002A>"
+noexpr "<U005E><U005B><U006E><U004E><U005D><U002E><U002A>"
+yesstr "<U0053><U0069>"
+nostr "<U004E><U006F>"
+END LC_MESSAGES
+
+LC_MEASUREMENT
+copy "fr_FR"
+END LC_MEASUREMENT
+
+LC_PAPER
+copy "fr_FR"
+END LC_PAPER
+
+LC_NAME
+copy "fr_FR"
+END LC_NAME
+
+LC_ADDRESS
+postal_fmt "<U0025><U0066><U0025><U004E><U0025><U0061><U0025><U004E>/
+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
+<U0074><U0025><U0068><U0074><U0025><U0065><U0074><U0025><U0072><U0025>/
+<U004E><U0025><U007A><U0074><U0025><U0054><U0025>/
+<U004E><U0025><U0063><U0025><U004E>"
+country_post "<U0046>"
+country_ab2 "<U0046><U0052>"
+country_ab3 "<U0046><U0052><U0041>"
+country_num 250
+country_isbn 2
+country_car "<U0046>"
+lang_name "<U0049><U006E><U0074><U0065><U0072><U006C><U0069><U006E><U0067><U0075><U0061>"
+lang_ab "<U0069><U0061>"
+lang_term "<U0069><U006E><U0061>"
+lang_lib "<U0069><U006E><U0061>"
+END LC_ADDRESS
+
+LC_TELEPHONE
+copy "fr_FR"
+END LC_TELEPHONE
diff --git a/libc/localedata/locales/niu_NU b/libc/localedata/locales/niu_NU
new file mode 100644
index 000000000..9b2c4510d
--- /dev/null
+++ b/libc/localedata/locales/niu_NU
@@ -0,0 +1,193 @@
+comment_char %
+escape_char /
+% Charset: UTF-8
+LC_IDENTIFICATION
+title "Niuean (Vagahau Niue) locale for Niue"
+source "RockET Systems"
+address "PO Box 229, Fatalupe, Alofi, Niue"
+contact "Emani Fakaotimanava-Lui"
+email "emani@niue.nu"
+tel "006834638"
+fax ""
+language "Vagahau Niue (Niuean)"
+territory "Niue"
+revision "1.0"
+date "2012-07-18"
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% Niuean, Vagahau Niue language locale for Niue
+%
+% Charset: UTF-8
+%
+% Niuean terms provided by Emani Fakaotimanava-Lui <emani@niue.nu>
+%
+% Prepared and contributed to glibc by Chris Leonard <cjl@sugarlabs.org> and
+% Emani Fakaotimanava-Lui <emani@niue.nu>
+%
+% This locale data has been developed in collaboration between:
+% Sugar Labs, http://www.sugarlabs.org/
+% RockET Systems, http://rocketsystems.nu/
+%
+% with support from the Internet Society (ISOC)
+% http://pacific.scoop.co.nz/2012/06/internet-society-funds-niue-language-lifeline/
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+category "niu_NU:2012";LC_IDENTIFICATION
+category "niu_NU:2012";LC_CTYPE
+category "niu_NU:2012";LC_COLLATE
+category "niu_NU:2012";LC_TIME
+category "niu_NU:2012";LC_NUMERIC
+category "niu_NU:2012";LC_MONETARY
+category "niu_NU:2012";LC_PAPER
+category "niu_NU:2012";LC_MEASUREMENT
+category "niu_NU:2012";LC_MESSAGES
+category "niu_NU:2012";LC_NAME
+category "niu_NU:2012";LC_ADDRESS
+category "niu_NU:2012";LC_TELEPHONE
+END LC_IDENTIFICATION
+
+LC_CTYPE
+copy "i18n"
+
+translit_start
+include "translit_combining";""
+translit_end
+END LC_CTYPE
+
+LC_COLLATE
+copy "iso14651_t1"
+END LC_COLLATE
+
+LC_TIME
+
+% Ianuali, Fepuali, Masi, Apelila, Me, Iuni, Iulai, Aokuso, Sepetema,
+% Oketopa, Novema, Tesemo
+
+mon "<U0049><U0061><U006E><U0075><U0061><U006C><U0069>";/
+ "<U0046><U0065><U0070><U0075><U0061><U006C><U0069>";/
+ "<U004D><U0061><U0073><U0069>";/
+ "<U0041><U0070><U0065><U006C><U0069><U006C><U0061>";/
+ "<U004D><U0065>";/
+ "<U0049><U0075><U006E><U0069>";/
+ "<U0049><U0075><U006C><U0061><U0069>";/
+ "<U0041><U006F><U006B><U0075><U0073><U006F>";/
+ "<U0053><U0065><U0070><U0065><U0074><U0065><U006D><U0061>";/
+ "<U004F><U006B><U0065><U0074><U006F><U0070><U0061>";/
+ "<U004E><U006F><U0076><U0065><U006D><U0061>";/
+ "<U0054><U0065><U0073><U0065><U006D><U006F>"
+
+% Ian, Fep, Mas, Ape, Me, Iun, Iul, Aok, Sep, Oke, Nov, Tes
+abmon "<U0049><U0061><U006E>";/
+ "<U0046><U0065><U0070>";/
+ "<U004D><U0061><U0073>";/
+ "<U0041><U0070><U0065>";/
+ "<U004D><U0065>";/
+ "<U0049><U0075><U006E>";/
+ "<U0049><U0075><U006C>";/
+ "<U0041><U006F><U006B>";/
+ "<U0053><U0065><U0070>";/
+ "<U004F><U006B><U0065>";/
+ "<U004E><U006F><U0076>";/
+ "<U0054><U0065><U0073>"
+
+% Aho Tapu, Aho Gofua, Aho Ua, Aho Lotu, Aho Tuloto, Aho Falaile, Aho Faiumu
+day "<U0041><U0068><U006F><U0020><U0054><U0061><U0070><U0075>";/
+ "<U0041><U0068><U006F><U0020><U0047><U006F><U0066><U0075><U0061>";/
+ "<U0041><U0068><U006F><U0020><U0055><U0061>";/
+ "<U0041><U0068><U006F><U0020><U004C><U006F><U0074><U0075>";/
+ "<U0041><U0068><U006F><U0020><U0054><U0075><U006C><U006F><U0074><U006F>";/
+ "<U0041><U0068><U006F><U0020><U0046><U0061><U006C><U0061><U0069><U006C><U0065>";/
+ "<U0041><U0068><U006F><U0020><U0046><U0061><U0069><U0075><U006D><U0075>"
+
+% Tapu, Gofua, Ua, Lotu, Tuloto, Falaile, Faiumu
+abday "<U0054><U0061><U0070><U0075>";/
+ "<U0047><U006F><U0066><U0075><U0061>";/
+ "<U0055><U0061>";/
+ "<U004C><U006F><U0074><U0075>";/
+ "<U0054><U0075><U006C><U006F><U0074><U006F>";/
+ "<U0046><U0061><U006C><U0061><U0069><U006C><U0065>";/
+ "<U0046><U0061><U0069><U0075><U006D><U0075>"
+
+% Abbreviated date and time representation to be referenced by the "%c" field descriptor -
+%
+% "%a" (short weekday name),
+% "%d" (day of month as a decimal number),
+% "%b" (short month name),
+% "%Y" (year with century as a decimal number),
+% "%T" (24-hour clock time in format HH:MM:SS),
+% "%Z" (Time zone name)
+% %a %d %b %Y %T %Z
+d_t_fmt "<U0025><U0061><U0020><U0025><U0064><U0020><U0025><U0062><U0020><U0025><U0059><U0020><U0025><U0054><U0020><U0025><U005A>"
+
+% Date representation to be referenced by the "%x" field descriptor -
+% "%d/%m/%Y", day/month/year as decimal numbers (01/01/2000).
+d_fmt "<U0025><U0064><U002F><U0025><U006D><U002F><U0025><U0079>"
+
+% Time representation to be referenced by the "%X" field descriptor -
+% "%T" (24-hour clock time in format HH:MM:SS)
+t_fmt "<U0025><U0054>"
+
+am_pm "<U0041><U004D>";"<U0050><U004D>"
+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020>/
+<U0025><U0070>"
+
+END LC_TIME
+
+LC_NUMERIC
+copy "en_NZ"
+END LC_NUMERIC
+
+LC_MONETARY
+copy "en_NZ"
+END LC_MONETARY
+
+LC_PAPER
+copy "en_NZ"
+END LC_PAPER
+
+LC_MEASUREMENT
+measurement 1
+END LC_MEASUREMENT
+
+LC_MESSAGES
+
+% ^[ēĒ].*
+yesexpr "<U005E><U005B><U0113><U0112><U0079><U0059><U005D><U002E><U002A>"
+
+% ^[nN].*
+noexpr "<U005E><U005B><U006E><U004E><U005D><U002E><U002A>"
+
+% Talia
+yesstr "<U0054><U0061><U006C><U0069><U0061>"
+
+% Nakai
+nostr "<U004E><U0061><U006B><U0061><U0069>"
+
+END LC_MESSAGES
+
+LC_NAME
+copy "en_NZ"
+END LC_NAME
+
+LC_ADDRESS
+% %f%N%a%N%d%N%b%N%s %h %e %r%N%z %T%N%c%N
+postal_fmt "<U0025><U0066><U0025><U004E><U0025><U0061><U0025><U004E><U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073><U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025><U004E><U0025><U007A><U0020><U0025><U0054><U0025><U004E><U0025><U0063><U0025><U004E>"
+% NU
+country_post "<U004E><U0055>"
+% NU
+country_ab2 "<U004E><U0055>"
+% NIU
+country_ab3 "<U004E><U0049><U0055>"
+country_num 570
+% niu
+lang_term "<U006E><U0069><U0075>"
+END LC_ADDRESS
+
+LC_TELEPHONE
+% +%c %a %l
+tel_int_fmt "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025><U006C>"
+% 683
+int_prefix "<U0036><U0038><U0033>"
+END LC_TELEPHONE
diff --git a/libc/localedata/locales/niu_NZ b/libc/localedata/locales/niu_NZ
new file mode 100644
index 000000000..25f58a90b
--- /dev/null
+++ b/libc/localedata/locales/niu_NZ
@@ -0,0 +1,190 @@
+comment_char %
+escape_char /
+% Charset: UTF-8
+LC_IDENTIFICATION
+title "Niuean (Vagahau Niue) locale for New Zealand"
+source "RockET Systems"
+address "PO Box 229, Fatalupe, Alofi, Niue"
+contact "Emani Fakaotimanava-Lui"
+email "emani@niue.nu"
+tel "006834638"
+fax ""
+language "Vagahau Niue (Niuean)"
+territory "New Zealand"
+revision "1.0"
+date "2012-07-18"
+% This file is distributed under the same license as the glibc package.
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% Niuean, Vagahau Niue language locale for New Zealand
+%
+% Charset: UTF-8
+%
+% Niuean terms provided by Emani Fakaotimanava-Lui <emani@niue.nu>
+%
+% Prepared and contributed to glibc by Chris Leonard <cjl@sugarlabs.org> and
+% Emani Fakaotimanava-Lui <emani@niue.nu>
+%
+% This locale data has been developed in collaboration between:
+% Sugar Labs, http://www.sugarlabs.org/
+% RockET Systems, http://rocketsystems.nu/
+%
+% with support from the Internet Society (ISOC)
+% http://pacific.scoop.co.nz/2012/06/internet-society-funds-niue-language-lifeline/
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+category "niu_NZ:2012";LC_IDENTIFICATION
+category "niu_NZ:2012";LC_CTYPE
+category "niu_NZ:2012";LC_COLLATE
+category "niu_NZ:2012";LC_TIME
+category "niu_NZ:2012";LC_NUMERIC
+category "niu_NZ:2012";LC_MONETARY
+category "niu_NZ:2012";LC_PAPER
+category "niu_NZ:2012";LC_MEASUREMENT
+category "niu_NZ:2012";LC_MESSAGES
+category "niu_NZ:2012";LC_NAME
+category "niu_NZ:2012";LC_ADDRESS
+category "niu_NZ:2012";LC_TELEPHONE
+END LC_IDENTIFICATION
+
+LC_CTYPE
+copy "i18n"
+
+translit_start
+include "translit_combining";""
+translit_end
+END LC_CTYPE
+
+LC_COLLATE
+copy "iso14651_t1"
+END LC_COLLATE
+
+
+LC_TIME
+
+% Ianuali, Fepuali, Masi, Apelila, Me, Iuni, Iulai, Aokuso, Sepetema,
+% Oketopa, Novema, Tesemo
+mon "<U0049><U0061><U006E><U0075><U0061><U006C><U0069>";/
+ "<U0046><U0065><U0070><U0075><U0061><U006C><U0069>";/
+ "<U004D><U0061><U0073><U0069>";/
+ "<U0041><U0070><U0065><U006C><U0069><U006C><U0061>";/
+ "<U004D><U0065>";/
+ "<U0049><U0075><U006E><U0069>";/
+ "<U0049><U0075><U006C><U0061><U0069>";/
+ "<U0041><U006F><U006B><U0075><U0073><U006F>";/
+ "<U0053><U0065><U0070><U0065><U0074><U0065><U006D><U0061>";/
+ "<U004F><U006B><U0065><U0074><U006F><U0070><U0061>";/
+ "<U004E><U006F><U0076><U0065><U006D><U0061>";/
+ "<U0054><U0065><U0073><U0065><U006D><U006F>"
+
+% Ian, Fep, Mas, Ape, Me, Iun, Iul, Aok, Sep, Oke, Nov, Tes
+abmon "<U0049><U0061><U006E>";/
+ "<U0046><U0065><U0070>";/
+ "<U004D><U0061><U0073>";/
+ "<U0041><U0070><U0065>";/
+ "<U004D><U0065>";/
+ "<U0049><U0075><U006E>";/
+ "<U0049><U0075><U006C>";/
+ "<U0041><U006F><U006B>";/
+ "<U0053><U0065><U0070>";/
+ "<U004F><U006B><U0065>";/
+ "<U004E><U006F><U0076>";/
+ "<U0054><U0065><U0073>"
+
+% Aho Tapu, Aho Gofua, Aho Ua, Aho Lotu, Aho Tuloto, Aho Falaile, Aho Faiumu
+day "<U0041><U0068><U006F><U0020><U0054><U0061><U0070><U0075>";/
+ "<U0041><U0068><U006F><U0020><U0047><U006F><U0066><U0075><U0061>";/
+ "<U0041><U0068><U006F><U0020><U0055><U0061>";/
+ "<U0041><U0068><U006F><U0020><U004C><U006F><U0074><U0075>";/
+ "<U0041><U0068><U006F><U0020><U0054><U0075><U006C><U006F><U0074><U006F>";/
+ "<U0041><U0068><U006F><U0020><U0046><U0061><U006C><U0061><U0069><U006C><U0065>";/
+ "<U0041><U0068><U006F><U0020><U0046><U0061><U0069><U0075><U006D><U0075>"
+
+% Tapu, Gofua, Ua, Lotu, Tuloto, Falaile, Faiumu
+abday "<U0054><U0061><U0070><U0075>";/
+ "<U0047><U006F><U0066><U0075><U0061>";/
+ "<U0055><U0061>";/
+ "<U004C><U006F><U0074><U0075>";/
+ "<U0054><U0075><U006C><U006F><U0074><U006F>";/
+ "<U0046><U0061><U006C><U0061><U0069><U006C><U0065>";/
+ "<U0046><U0061><U0069><U0075><U006D><U0075>"
+
+% Abbreviated date and time representation to be referenced by the "%c" field descriptor -
+%
+% "%a" (short weekday name),
+% "%d" (day of month as a decimal number),
+% "%b" (short month name),
+% "%Y" (year with century as a decimal number),
+% "%T" (24-hour clock time in format HH:MM:SS),
+% "%Z" (Time zone name)
+% %a %d %b %Y %T %Z
+d_t_fmt "<U0025><U0061><U0020><U0025><U0064><U0020><U0025><U0062><U0020><U0025><U0059><U0020><U0025><U0054><U0020><U0025><U005A>"
+
+% Date representation to be referenced by the "%x" field descriptor -
+% "%d/%m/%Y", day/month/year as decimal numbers (01/01/2000).
+d_fmt "<U0025><U0064><U002F><U0025><U006D><U002F><U0025><U0079>"
+
+% Time representation to be referenced by the "%X" field descriptor -
+% "%T" (24-hour clock time in format HH:MM:SS)
+t_fmt "<U0025><U0054>"
+
+am_pm "<U0041><U004D>";"<U0050><U004D>"
+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020>/
+<U0025><U0070>"
+
+END LC_TIME
+
+LC_NUMERIC
+copy "en_NZ"
+END LC_NUMERIC
+
+LC_MONETARY
+copy "en_NZ"
+END LC_MONETARY
+
+LC_PAPER
+copy "en_NZ"
+END LC_PAPER
+
+LC_MEASUREMENT
+measurement 1
+END LC_MEASUREMENT
+
+LC_MESSAGES
+
+% ^[ēĒ].*
+yesexpr "<U005E><U005B><U0113><U0112><U0079><U0059><U005D><U002E><U002A>"
+
+% ^[nN].*
+noexpr "<U005E><U005B><U006E><U004E><U005D><U002E><U002A>"
+
+% Talia
+yesstr "<U0054><U0061><U006C><U0069><U0061>"
+
+% Nakai
+nostr "<U004E><U0061><U006B><U0061><U0069>"
+
+END LC_MESSAGES
+
+
+LC_NAME
+copy "en_NZ"
+END LC_NAME
+
+LC_ADDRESS
+% %f%N%a%N%d%N%b%N%s %h %e %r%N%z %T%N%c%N
+postal_fmt "<U0025><U0066><U0025><U004E><U0025><U0061><U0025><U004E><U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073><U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025><U004E><U0025><U007A><U0020><U0025><U0054><U0025><U004E><U0025><U0063><U0025><U004E>"
+% NZ
+country_ab2 "<U004E><U005A>"
+% NZL
+country_ab3 "<U004E><U005A><U004C>"
+country_num 554
+% niu
+lang_term "<U006E><U0069><U0075>"
+END LC_ADDRESS
+
+LC_TELEPHONE
+copy "en_NZ"
+END LC_TELEPHONE
diff --git a/libc/localedata/locales/szl_PL b/libc/localedata/locales/szl_PL
index b77898d8f..959611a2d 100644
--- a/libc/localedata/locales/szl_PL
+++ b/libc/localedata/locales/szl_PL
@@ -62,7 +62,7 @@ collating-symbol <nacute>
collating-symbol <otilde>
collating-symbol <omacron>
collating-symbol <ocircumflex>
-collating-symbol <U014F>
+collating-symbol <U_014F>
collating-symbol <zacute>
collating-symbol <zdot>
diff --git a/libc/localedata/locales/ug_CN b/libc/localedata/locales/ug_CN
index 3732d7bdc..c4e0a9ac1 100644
--- a/libc/localedata/locales/ug_CN
+++ b/libc/localedata/locales/ug_CN
@@ -3,14 +3,14 @@ comment_char %
%
% Uyghur language locale for China
% Source:
-% Contact: Pablo Saratxaga
-% Email: pablo@mandriva.com
-% Language: ug
+% Contact: Eagle Burkut
+% Email: eagle.burkut@gmail.com
+% Language: ug
% Territory: CN
-% Revision: 0.1
-% Date: 2005-11-08
-% Users: general
-% Charset: UTF-8
+% Revision: 2.00
+% Date: 2012-02-26
+% Users: general
+% Charset: UTF-8
% Distribution and use is free, also
% for commercial purposes.
@@ -18,14 +18,14 @@ LC_IDENTIFICATION
title "Uyghur locale for China"
source ""
address ""
-contact ""
-email "pablo@mandriva.com"
+contact "Eagle Burkut"
+email "eagle.burkut@gmail.com"
tel ""
fax ""
language "Uyghur"
territory "China"
-revision "0.1"
-date "2005-11-08"
+revision "2.00"
+date "2011-02-26"
%
category "ug_CN:2000";LC_IDENTIFICATION
category "ug_CN:2000";LC_CTYPE
@@ -33,6 +33,7 @@ category "ug_CN:2000";LC_COLLATE
category "ug_CN:2000";LC_TIME
category "ug_CN:2000";LC_NUMERIC
category "ug_CN:2000";LC_MONETARY
+category "ug_CN:2000";LC_MEASUREMENT
category "ug_CN:2000";LC_MESSAGES
category "ug_CN:2000";LC_PAPER
category "ug_CN:2000";LC_NAME
@@ -43,209 +44,178 @@ END LC_IDENTIFICATION
LC_COLLATE
-% letters list and sort order from
+%
% http://en.wikipedia.org/wiki/Uyghur_language
-% sorting order guessed for old latin writting
%
-% old latin writting is based in pinyin, with some extra letters:
-% <schwa>, <z with tail>, <gh>, <k with tail>, <h with tail>,
-% <barred o> (they seem inspired from cyrillic)
-% tail letters can be written with base letter + combining tail U+0321
-% there are also reserved codepoints U+2C67-U+2C6C for them in
-% unicode 5.0 proposal.
-% U+0224, U+0225 are also similar to ztail and are sorted the same.
+% CODE - UNICODE CODE POINT
+% UL - UYGHUR LATIN
+% IN? - IN ISO 14651_T1
%
-% new arabic writting uses some extra letters too.
-% all vowels are noted, and in beginning of the word there is a
-% "yeh with hamza" (U+0626) in the front; should it be ignored
-% in sorting?
+% NO CODE UL ENGLISH NAME AR IN?
+% ======================================
+% 1 0627 a alef ا
+% 2 06d5 e ae ە ???
+% 3 0628 b beh ب
+% 4 067e p peh پ
+% 5 062a t teh ت
+% 6 062c j jeem ج
+% 7 0686 ch tcheh چ
+% 8 062e x khah خ
+% 9 062f d dal د
+% 10 0631 r reh ر
+% 11 0632 z zain ز
+% 12 0698 zh jeh ژ
+% 13 0633 s seen س
+% 14 0634 sh sheen ش
+% 15 063a gh ghain غ
+% 16 0641 f feh ف
+% 17 0642 q qaf ق
+% 18 0643 k kaf ك
+% 19 06af g gaf گ
+% 20 06ad ng ng ڭ ???
+% 21 0644 l lam ل
+% 22 0645 m meem م
+% 23 0646 n noon ن
+% 24 06be h heh doachashmee ھ ???
+% 25 0648 o waw و
+% 26 06c7 u u ۇ ???
+% 27 06c6 ö oe ۆ ???
+% 28 06c8 ü yu ۈ ???
+% 29 06cb w ve ۋ ???
+% 30 06d0 é e ې ???
+% 31 0649 i alef maksura ى
+% 32 064a y yeh ي ???
+% -- 0626 ' yeh with hamza above ئ ???
%
-% arabic old latin turkic (from azeri, which has same phonemes)
-% ========== =============== ======
-% alef 0627 a a
-% ae 06d5 schwa 018F,0259 ä
-% beh 0628 b b
-% peh 067e p p
-% teh 062a t t
-% jeem 062c j c <
-% tcheh 0686 q ç <
-% khah 062e h x <
-% dal 062f d d
-% reh 0631 r r
-% zain 0632 z z
-% jeh 0698 ztail 0224,0225 j <
-% seen 0633 s s
-% sheen 0634 x ş
-% ghain 063a gh 01a2,01a3 ğ <
-% feh 0641 f f
-% qaf 0642 ktail q <
-% kaf 0643 k k
-% ng 06ad ng ñ <
-% gaf 06af g g
-% lam 0644 l l
-% meem 0645 m m
-% noon 0646 n n
-% heh 0647 htail h <
-% waw 0648 o o
-% u 06c7 u u
-% oe 06c6 obar 019f,0275 ö <
-% yu 06c8 ü ü
-% ve 06cb v v
-% e 06d0 e e
-% f.yeh 06cc i i (or alef maqsura 0649?)
-% yeh 064a y y
-% (<): differences between old latin and turkic writting
-
copy "iso14651_t1"
-collating-symbol <schwa>
-collating-symbol <gh>
-collating-symbol <ng>
-collating-symbol <ccedilla>
-collating-symbol <scedilla>
-collating-symbol <htail>
-collating-symbol <ktail>
-collating-symbol <ztail>
-collating-symbol <obar>
-collating-symbol <udiaeresis>
-
-collating-element <h,> from "<U0068><U0321>"
-collating-element <H,> from "<U0048><U0321>"
-collating-element <k,> from "<U006B><U0321>"
-collating-element <K,> from "<U004B><U0321>"
-collating-element <z,> from "<U007A><U0321>"
-collating-element <Z,> from "<U005A><U0321>"
-
-collating-symbol <ar_ae>
-collating-symbol <ar_ng>
-collating-symbol <ar_u>
-collating-symbol <ar_oe>
-collating-symbol <ar_yu>
-collating-symbol <ar_ve>
-collating-symbol <ar_e>
-collating-symbol <ar_i>
-collating-symbol <ar_y>
-
-% latin
-reorder-after <a>
-<schwa>
-reorder-after <c>
-<ccedilla>
-reorder-after <g>
-<gh>
-reorder-after <h>
-<htail>
-reorder-after <k>
-<ktail>
-reorder-after <n>
-<ng>
-reorder-after <o>
-<obar>
-reorder-after <s>
-<scedilla>
-reorder-after <u>
-<udiaeresis>
-reorder-after <z>
-<ztail>
-
-reorder-after <U0061>
-<U0259> <schwa>;<PCL>;<MIN>;IGNORE
-<U00E4> <schwa>;<REU>;<MIN>;IGNORE
-reorder-after <U0041>
-<U018F> <schwa>;<PCL>;<CAP>;IGNORE
-<U00C4> <schwa>;<REU>;<CAP>;IGNORE
-
-reorder-after <U0063>
-<U00E7> <ccedilla>;<CDI>;<MIN>;IGNORE
-reorder-after <U0043>
-<U00C7> <ccedilla>;<CDI>;<CAP>;IGNORE
-
-reorder-after <U0067>
-<U01A3> <gh>;<PCL>;<MIN>;IGNORE
-<U011F> <gh>;<BRE>;<MIN>;IGNORE
-reorder-after <U0047>
-<U01A2> <gh>;<PCL>;<CAP>;IGNORE
-<U011E> <gh>;<BRE>;<CAP>;IGNORE
-
-reorder-after <U0068>
-<U2C68> <htail>;<PCL>;<MIN>;IGNORE
-<h,> <htail>;<PCL>;<MIN>;IGNORE
-reorder-after <U0048>
-<U2C67> <htail>;<PCL>;<CAP>;IGNORE
-<H,> <htail>;<PCL>;<CAP>;IGNORE
-
-reorder-after <U006B>
-<U2C6A> <ktail>;<PCL>;<MIN>;IGNORE
-<k,> <ktail>;<PCL>;<MIN>;IGNORE
-reorder-after <U004B>
-<U2C69> <ktail>;<PCL>;<CAP>;IGNORE
-<K,> <ktail>;<PCL>;<CAP>;IGNORE
-
-reorder-after <U006E>
-<U00F1> <ng>;<TIL>;<MIN>;IGNORE
-reorder-after <U004E>
-<U00D1> <ng>;<TIL>;<CAP>;IGNORE
-
-reorder-after <U006F>
-<U0275> <obar>;<PCL>;<MIN>;IGNORE
-<U00F6> <obar>;<REU>;<MIN>;IGNORE
-reorder-after <U004F>
-<U019F> <obar>;<PCL>;<CAP>;IGNORE
-<U00D6> <obar>;<REU>;<CAP>;IGNORE
-
-reorder-after <U0073>
-<U015F> <scedilla>;<CDI>;<MIN>;IGNORE
-reorder-after <U0053>
-<U015E> <scedilla>;<CDI>;<CAP>;IGNORE
-
-reorder-after <U0075>
-<U00FC> <udiaeresis>;<REU>;<MIN>;IGNORE
-reorder-after <U0055>
-<U00DC> <udiaeresis>;<REU>;<CAP>;IGNORE
-
-reorder-after <U007A>
-<U2C6C> <ztail>;<PCL>;<MIN>;IGNORE
-<z,> <ztail>;<PCL>;<MIN>;IGNORE
-<U0225> <ztail>;<PCL>;<MIN>;IGNORE
-reorder-after <U005A>
-<U2C6B> <ztail>;<PCL>;<CAP>;IGNORE
-<Z,> <ztail>;<PCL>;<CAP>;IGNORE
-<U0224> <ztail>;<PCL>;<CAP>;IGNORE
-
-% arabic
+% <yeh with hamza above> + <alef> = ئا
+collating-symbol <ARA_ywha_alef>
+
+% <yeh with hamza above> + <ae> = ئە
+collating-symbol <ARA_ywha_ae>
+
+% <ae> = ە
+collating-symbol <ARA_ae>
+
+% <ng> = ڭ
+collating-symbol <ARA_ng>
+
+% <heh doachashmee> = ھ
+collating-symbol <ARA_hehd>
+
+% <yeh with hamza above> + <waw> = ئو
+collating-symbol <ARA_ywha_waw>
+
+% <yeh with hamza above> + <u> = ئۇ
+collating-symbol <ARA_ywha_u>
+
+% <u> = ۇ
+collating-symbol <ARA_u>
+
+% <yeh with hamza above> + <oe> = ئۆ
+collating-symbol <ARA_ywha_oe>
+
+% <oe> = ۆ
+collating-symbol <ARA_oe>
+
+% <yeh with hamza above> + <yu> = ئۈ
+collating-symbol <ARA_ywha_yu>
+
+% <yu> = ۈ
+collating-symbol <ARA_yu>
+
+% <ve> = ۋ
+collating-symbol <ARA_ve>
+
+% <yeh with hamza above> + <e> = ئې
+collating-symbol <ARA_ywha_e>
+
+% <e> = ې
+collating-symbol <ARA_e>
+
+% <yeh with hamza above> + <alef maksura> = ئى
+collating-symbol <ARA_ywha_alma>
+
+% <yeh> = ي
+collating-symbol <ARA_yeh>
+
+% <yeh with hamza above> = ئ
+collating-symbol <ARA_ywha>
+
+collating-element <ara_h_alef> from "<U0626><U0627>" % ئا
+collating-element <ara_h_ae> from "<U0626><U06D5>" % ئە
+collating-element <ara_h_waw> from "<U0626><U0648>" % ئو
+collating-element <ara_h_u> from "<U0626><U06C7>" % ئۇ
+collating-element <ara_h_oe> from "<U0626><U06C6>" % ئۆ
+collating-element <ara_h_yu> from "<U0626><U06C8>" % ئۈ
+collating-element <ara_h_e> from "<U0626><U06D0>" % ئې
+collating-element <ara_h_alma> from "<U0626><U0649>" % ئى
+
reorder-after <alef>
-<ar_ae>
-reorder-after <keheh>
-<ar_ng>
+<ARA_ywha_alef>
+<alef>
+<ARA_ywha_ae>
+<ARA_ae>
+
+reorder-after <gaf>
+<ARA_ng>
+
+reorder-after <noon>
+<ARA_hehd>
+
reorder-after <waw>
-<ar_u>
-<ar_oe>
-<ar_yu>
-<ar_ve>
-<ar_e>
-<ar_i>
-<ar_y>
-
-reorder-after <U0627>
-<U06D5> <ar_ae>;<BAS>;<MIN>;IGNORE
-reorder-after <U06A9>
-<U06AD> <ar_ng>;<BAS>;<MIN>;IGNORE
-reorder-after <U0648>
-<U06C7> <ar_u>;<BAS>;<MIN>;IGNORE
-<U06C6> <ar_oe>;<BAS>;<MIN>;IGNORE
-<U06C8> <ar_yu>;<BAS>;<MIN>;IGNORE
-<U06CB> <ar_ve>;<BAS>;<MIN>;IGNORE
-<U06D0> <ar_e>;<BAS>;<MIN>;IGNORE
-<U06CC> <ar_i>;<BAS>;<MIN>;IGNORE
-<U064A> <ar_y>;<BAS>;<MIN>;IGNORE
+<ARA_ywha_waw>
+<waw>
+<ARA_ywha_u>
+<ARA_u>
+<ARA_ywha_oe>
+<ARA_oe>
+<ARA_ywha_yu>
+<ARA_yu>
+<ARA_ve>
+<ARA_ywha_e>
+<ARA_e>
+<ARA_ywha_alma>
+<alef_maksura>
+<ARA_yeh>
+<ARA_ywha>
+
+reorder-after <U0627>
+<ara_h_alef> <ARA_ywha_alef>;<BAS>;<MIN>;IGNORE
+<U0627> <alef>;<BAS>;<MIN>;IGNORE
+<ara_h_ae> <ARA_ywha_ae>;<BAS>;<MIN>;IGNORE
+<U06D5> <ARA_ae>;<BAS>;<MIN>;IGNORE
+
+reorder-after <U06AF>
+<U06AD> <ARA_ng>;<BAS>;<MIN>;IGNORE
+
+reorder-after <U0646>
+<U06BE> <ARA_hehd>;<BAS>;<MIN>;IGNORE
+
+reorder-after <U0648>
+<ara_ywha_waw> <ARA_ywha_waw>;<BAS>;<MIN>;IGNORE
+<U0648> <waw>;<BAS>;<MIN>;IGNORE
+<ara_ywha_u> <ARA_ywha_u>;<BAS>;<MIN>;IGNORE
+<U06C7> <ARA_u>;<BAS>;<MIN>;IGNORE
+<ara_ywha_oe> <ARA_ywha_oe>;<BAS>;<MIN>;IGNORE
+<U06C6> <ARA_oe>;<BAS>;<MIN>;IGNORE
+<ara_ywha_yu> <ARA_ywha_yu>;<BAS>;<MIN>;IGNORE
+<U06C8> <ARA_yu>;<BAS>;<MIN>;IGNORE
+<U06CB> <ARA_ve>;<BAS>;<MIN>;IGNORE
+<ara_ywha_e> <ARA_ywha_e>;<BAS>;<MIN>;IGNORE
+<U06D0> <ARA_e>;<BAS>;<MIN>;IGNORE
+<ara_ywha_alma> <ARA_ywha_alma>;<BAS>;<MIN>;IGNORE
+<U0649> <alef_maksura>;<BAS>;<MIN>;IGNORE
+<U064A> <ARA_yeh>;<BAS>;<MIN>;IGNORE
+<U0626> <ARA_ywha>;<BAS>;<MIN>;IGNORE
reorder-end
END LC_COLLATE
LC_CTYPE
-% FIXME
-copy "en_DK"
+copy "i18n"
END LC_CTYPE
LC_MONETARY
@@ -261,59 +231,75 @@ copy "zh_CN"
END LC_TELEPHONE
LC_TIME
-% FIXME
-abday "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
- "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
- "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
- "<U0053><U0061><U0074>"
-day "<U0053><U0075><U006E><U0064><U0061><U0079>";/
- "<U004D><U006F><U006E><U0064><U0061><U0079>";/
- "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
- "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
- "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
- "<U0046><U0072><U0069><U0064><U0061><U0079>";/
- "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-abmon "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
- "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
- "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
- "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
- "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
- "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-mon "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
- "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
- "<U004D><U0061><U0072><U0063><U0068>";/
- "<U0041><U0070><U0072><U0069><U006C>";/
- "<U004D><U0061><U0079>";/
- "<U004A><U0075><U006E><U0065>";/
- "<U004A><U0075><U006C><U0079>";/
- "<U0041><U0075><U0067><U0075><U0073><U0074>";/
- "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
- "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
- "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
- "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-% date formats following ISO 8601-1988
-d_t_fmt "<U0025><U0059><U002D><U0025><U006D><U002D><U0025><U0064><U0054><U0025><U0054><U0020><U0025><U005A>"
-d_fmt "<U0025><U0059><U002D><U0025><U006D><U002D><U0025><U0064>"
+
+abday "<U064A>";/
+ "<U062F>";/
+ "<U0633>";/
+ "<U0686>";/
+ "<U067E>";/
+ "<U062C>";/
+ "<U0634>"
+day "<U064A><U06D5><U0643><U0634><U06D5><U0646><U0628><U06D5>";/
+ "<U062F><U06C8><U0634><U06D5><U0646><U0628><U06D5>";/
+ "<U0633><U06D5><U064A><U0634><U06D5><U0646><U0628><U06D5>";/
+ "<U0686><U0627><U0631><U0634><U06D5><U0646><U0628><U06D5>";/
+ "<U067E><U06D5><U064A><U0634><U06D5><U0646><U0628><U06D5>";/
+ "<U062C><U06C8><U0645><U06D5>";/
+ "<U0634><U06D5><U0646><U0628><U06D5>"
+abmon "<U0642><U06D5><U06BE><U0631><U0649><U062A><U0627><U0646>";/
+ "<U06BE><U06C7><U062A>";/
+ "<U0646><U0648><U0631><U06C7><U0632>";/
+ "<U0626><U06C8><U0645><U0649><U062F>";/
+ "<U0628><U0627><U06BE><U0627><U0631>";/
+ "<U0633><U06D5><U067E><U06D5><U0631>";/
+ "<U0686><U0649><U0644><U0644><U06D5>";/
+ "<U062A><U0648><U0645><U06C7><U0632>";/
+ "<U0645><U0649><U0632><U0627><U0646>";/
+ "<U0626><U0648><U063A><U06C7><U0632>";/
+ "<U0626><U0648><U063A><U0644><U0627><U0642>";/
+ "<U0643><U06C6><U0646><U06D5><U0643>"
+mon "<U0642><U06D5><U06BE><U0631><U0649><U062A><U0627><U0646>";/
+ "<U06BE><U06C7><U062A>";/
+ "<U0646><U0648><U0631><U06C7><U0632>";/
+ "<U0626><U06C8><U0645><U0649><U062F>";/
+ "<U0628><U0627><U06BE><U0627><U0631>";/
+ "<U0633><U06D5><U067E><U06D5><U0631>";/
+ "<U0686><U0649><U0644><U0644><U06D5>";/
+ "<U062A><U0648><U0645><U06C7><U0632>";/
+ "<U0645><U0649><U0632><U0627><U0646>";/
+ "<U0626><U0648><U063A><U06C7><U0632>";/
+ "<U0626><U0648><U063A><U0644><U0627><U0642>";/
+ "<U0643><U06C6><U0646><U06D5><U0643>"
+
+% %a، %d-%m-%Y، %T (w، dd-mm-YYYY، HH:MM:SS) (قىسقا ھەپتە، 31-12-2012، 23:08:59)
+d_t_fmt "<U0025><U0061><U060C><U0020><U0025><U0064><U002D><U0025><U006D><U002D><U0025><U0059>/
+<U060C><U0020><U0025><U0054>"
+
+% %a، %d-%m-%Y (w، dd-mm-YYYY) (قىسقا ھەپتە، 31-12-2012)
+d_fmt "<U0025><U0061><U060C><U0020><U0025><U0064><U002D><U0025><U006D><U002D><U0025><U0059>"
+
+% %T (HH:MM:SS)
t_fmt "<U0025><U0054>"
+
am_pm "";""
-t_fmt_ampm ""
-date_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065>/
-<U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020>/
-<U0025><U005A><U0020><U0025><U0059>"
+
+% %a، %d-%m-%Y، %T (w، dd-mm-YYYY، HH:MM:SS) (قىسقا ھەپتە، 31-12-2012، 23:08:59)
+date_fmt "<U0025><U0061><U060C><U0020><U0025><U0064><U002D><U0025><U006D><U002D><U0025><U0059>/
+<U060C><U0020><U0025><U0054>"
+
END LC_TIME
LC_MESSAGES
-% FIXME
-yesexpr "<U005E><U005B><U0031><U004A><U006A><U0073><U0053><U0079><U0059><U006F><U004F><U005D><U002E><U002A>"
-noexpr "<U005E><U005B><U0030><U006E><U004E><U005D><U002E><U002A>"
-yesstr "yes"
-nostr "no"
+yesexpr "<U005E><U005B><U0079><U0059><U005D><U002E><U002A>"
+noexpr "<U005E><U005B><U006E><U004E><U005D><U002E><U002A>"
+yesstr "<U0059><U0065><U0073>"
+nostr "<U004E><U006F>"
END LC_MESSAGES
% Default paper: A4
LC_PAPER
height 297
-width 210
+width 210
END LC_PAPER
% Metric System (ISO 1000)
@@ -321,12 +307,10 @@ LC_MEASUREMENT
measurement 1
END LC_MEASUREMENT
-LC_NAME
-% FIXME
-copy "en_DK"
+LC_NAME % to be fixed
+copy "zh_CN"
END LC_NAME
-LC_ADDRESS
-% FIXME
-copy "en_DK"
+LC_ADDRESS % to be fixed
+copy "zh_CN"
END LC_ADDRESS
diff --git a/libc/malloc/mtrace.c b/libc/malloc/mtrace.c
index d7a032a86..3f02c7182 100644
--- a/libc/malloc/mtrace.c
+++ b/libc/malloc/mtrace.c
@@ -364,11 +364,16 @@ muntrace ()
if (mallstream == NULL)
return;
- fprintf (mallstream, "= End\n");
- fclose (mallstream);
+ /* Do the reverse of what done in mtrace: first reset the hooks and
+ MALLSTREAM, and only after that write the trailer and close the
+ file. */
+ FILE *f = mallstream;
mallstream = NULL;
__free_hook = tr_old_free_hook;
__malloc_hook = tr_old_malloc_hook;
__realloc_hook = tr_old_realloc_hook;
__memalign_hook = tr_old_memalign_hook;
+
+ fprintf (f, "= End\n");
+ fclose (f);
}
diff --git a/libc/manual/arith.texi b/libc/manual/arith.texi
index 3f4e56a6e..f387c8f1a 100644
--- a/libc/manual/arith.texi
+++ b/libc/manual/arith.texi
@@ -1064,7 +1064,7 @@ occur, you can use the following two functions.
@comment GNU
@deftypefun int feenableexcept (int @var{excepts})
This functions enables traps for each of the exceptions as indicated by
-the parameter @var{except}. The individual excepetions are described in
+the parameter @var{except}. The individual exceptions are described in
@ref{Status bit operations}. Only the specified exceptions are
enabled, the status of the other exceptions is not changed.
@@ -1076,7 +1076,7 @@ operation was successful, @code{-1} otherwise.
@comment GNU
@deftypefun int fedisableexcept (int @var{excepts})
This functions disables traps for each of the exceptions as indicated by
-the parameter @var{except}. The individual excepetions are described in
+the parameter @var{except}. The individual exceptions are described in
@ref{Status bit operations}. Only the specified exceptions are
disabled, the status of the other exceptions is not changed.
diff --git a/libc/math/libm-test.inc b/libc/math/libm-test.inc
index f15223589..7dfce9d65 100644
--- a/libc/math/libm-test.inc
+++ b/libc/math/libm-test.inc
@@ -1195,12 +1195,22 @@ atan_test (void)
TEST_f_f (atan, plus_infty, M_PI_2l);
TEST_f_f (atan, minus_infty, -M_PI_2l);
TEST_f_f (atan, nan_value, nan_value);
+ TEST_f_f (atan, max_value, M_PI_2l);
+ TEST_f_f (atan, -max_value, -M_PI_2l);
TEST_f_f (atan, 1, M_PI_4l);
TEST_f_f (atan, -1, -M_PI_4l);
TEST_f_f (atan, 0.75L, 0.643501108793284386802809228717322638L);
+ TEST_f_f (atan, 0x1p-100L, 0x1p-100L);
+#ifndef TEST_FLOAT
+ TEST_f_f (atan, 0x1p-600L, 0x1p-600L);
+#endif
+#if defined TEST_LDOUBLE && LDBL_MIN_EXP <= -16381
+ TEST_f_f (atan, 0x1p-10000L, 0x1p-10000L);
+#endif
+
END (atan);
}
@@ -1303,6 +1313,9 @@ atan2_test (void)
TEST_ff_f (atan2, max_value, max_value, M_PI_4l);
+ TEST_ff_f (atan2, max_value, min_value, M_PI_2l);
+ TEST_ff_f (atan2, -max_value, -min_value, -M_PI_2l);
+
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);
@@ -2521,12 +2534,12 @@ clog_test (void)
#endif
#if defined TEST_LDOUBLE && LDBL_MANT_DIG >= 106
TEST_c_c (clog, 0x1.00000000000000123456789abcp0L, 0x1.23456789p-60L, 9.868649107778739757272772275265050767867e-19L, 9.868649106423871142816660980898339912137e-19L);
- TEST_c_c (clog, 0x1.00000000000000123456789abcp0L, 0x1.23456789p-1000L, 9.868649107778739752403260515979017248596e-19L, 1.061846605795612822522063052130030717368e-301L);
+ TEST_c_c (clog, 0x1.00000000000000123456789abcp0L, 0x1.23456789p-1000L, 9.868649107778739752403260515979017248596e-19L, 1.061846605795612822522063052130030717368e-301L, UNDERFLOW_EXCEPTION_LDOUBLE_IBM);
#endif
TEST_c_c (clog, 0x0.ffffffp0L, 0x0.ffffffp-100L, -5.960464655174753498633255797994360530379e-8L, 7.888609052210118054117285652827862296732e-31L);
#ifndef TEST_FLOAT
- TEST_c_c (clog, 0x0.fffffffffffff8p0L, 0x0.fffffffffffff8p-1000L, -1.110223024625156602053389888482372171810e-16L, 9.332636185032188789900895447238171696171e-302L);
+ TEST_c_c (clog, 0x0.fffffffffffff8p0L, 0x0.fffffffffffff8p-1000L, -1.110223024625156602053389888482372171810e-16L, 9.332636185032188789900895447238171696171e-302L, UNDERFLOW_EXCEPTION_LDOUBLE_IBM);
#endif
#if defined TEST_LDOUBLE && LDBL_MIN_EXP <= -16381
TEST_c_c (clog, 0x0.ffffffffffffffffp0L, 0x0.ffffffffffffffffp-15000L, -5.421010862427522170184200798202494495630e-20L, 3.548665303440282824232502561095699343814e-4516L);
@@ -2741,12 +2754,12 @@ clog10_test (void)
#endif
#if defined TEST_LDOUBLE && LDBL_MANT_DIG >= 106
TEST_c_c (clog10, 0x1.00000000000000123456789abcp0L, 0x1.23456789p-60L, 4.285899851347756188767674032946882584784e-19L, 4.285899850759344225805480528847018395861e-19L);
- TEST_c_c (clog10, 0x1.00000000000000123456789abcp0L, 0x1.23456789p-1000L, 4.285899851347756186652871946325962330640e-19L, 4.611541215247321502041995872887317363241e-302L);
+ TEST_c_c (clog10, 0x1.00000000000000123456789abcp0L, 0x1.23456789p-1000L, 4.285899851347756186652871946325962330640e-19L, 4.611541215247321502041995872887317363241e-302L, UNDERFLOW_EXCEPTION_LDOUBLE_IBM);
#endif
TEST_c_c (clog10, 0x0.ffffffp0L, 0x0.ffffffp-100L, -2.588596909321764128428416045209904492216e-8L, 3.425979381266895667295625489912064603415e-31L);
#ifndef TEST_FLOAT
- TEST_c_c (clog10, 0x0.fffffffffffff8p0L, 0x0.fffffffffffff8p-1000L, -4.821637332766435821255375046554377090472e-17L, 4.053112396770095089737411317782466262176e-302L);
+ TEST_c_c (clog10, 0x0.fffffffffffff8p0L, 0x0.fffffffffffff8p-1000L, -4.821637332766435821255375046554377090472e-17L, 4.053112396770095089737411317782466262176e-302L, UNDERFLOW_EXCEPTION_LDOUBLE_IBM);
#endif
#if defined TEST_LDOUBLE && LDBL_MIN_EXP <= -16381
TEST_c_c (clog10, 0x0.ffffffffffffffffp0L, 0x0.ffffffffffffffffp-15000L, -2.354315103889861110220423157644627849164e-20L, 1.541165759405643564697852372112893034397e-4516L);
@@ -4897,6 +4910,7 @@ fma_test_towardzero (void)
TEST_fff_f (fma, -min_value, -min_value, plus_zero, plus_zero, UNDERFLOW_EXCEPTION);
TEST_fff_f (fma, -min_value, -min_value, minus_zero, plus_zero, UNDERFLOW_EXCEPTION);
+#if !(defined TEST_LDOUBLE && LDBL_MANT_DIG == 106) /* Bug 13304. */
TEST_fff_f (fma, max_value, max_value, min_value, max_value, OVERFLOW_EXCEPTION);
TEST_fff_f (fma, max_value, max_value, -min_value, max_value, OVERFLOW_EXCEPTION);
TEST_fff_f (fma, max_value, -max_value, min_value, -max_value, OVERFLOW_EXCEPTION);
@@ -4905,6 +4919,7 @@ fma_test_towardzero (void)
TEST_fff_f (fma, -max_value, max_value, -min_value, -max_value, OVERFLOW_EXCEPTION);
TEST_fff_f (fma, -max_value, -max_value, min_value, max_value, OVERFLOW_EXCEPTION);
TEST_fff_f (fma, -max_value, -max_value, -min_value, max_value, OVERFLOW_EXCEPTION);
+#endif
#if defined (TEST_FLOAT) && FLT_MANT_DIG == 24
TEST_fff_f (fma, 0x1.4p-126, 0x1.000004p-1, 0x1p-128, 0x1.c00004p-127, UNDERFLOW_EXCEPTION);
@@ -5115,6 +5130,7 @@ fma_test_downward (void)
TEST_fff_f (fma, -min_value, -min_value, plus_zero, plus_zero, UNDERFLOW_EXCEPTION);
TEST_fff_f (fma, -min_value, -min_value, minus_zero, plus_zero, UNDERFLOW_EXCEPTION);
+#if !(defined TEST_LDOUBLE && LDBL_MANT_DIG == 106) /* Bug 13304. */
TEST_fff_f (fma, max_value, max_value, min_value, max_value, OVERFLOW_EXCEPTION);
TEST_fff_f (fma, max_value, max_value, -min_value, max_value, OVERFLOW_EXCEPTION);
TEST_fff_f (fma, max_value, -max_value, min_value, minus_infty, OVERFLOW_EXCEPTION);
@@ -5123,6 +5139,7 @@ fma_test_downward (void)
TEST_fff_f (fma, -max_value, max_value, -min_value, minus_infty, OVERFLOW_EXCEPTION);
TEST_fff_f (fma, -max_value, -max_value, min_value, max_value, OVERFLOW_EXCEPTION);
TEST_fff_f (fma, -max_value, -max_value, -min_value, max_value, OVERFLOW_EXCEPTION);
+#endif
#if defined (TEST_FLOAT) && FLT_MANT_DIG == 24
TEST_fff_f (fma, 0x1.4p-126, 0x1.000004p-1, 0x1p-128, 0x1.c00004p-127, UNDERFLOW_EXCEPTION);
@@ -5333,6 +5350,7 @@ fma_test_upward (void)
TEST_fff_f (fma, -min_value, -min_value, plus_zero, min_subnorm_value, UNDERFLOW_EXCEPTION);
TEST_fff_f (fma, -min_value, -min_value, minus_zero, min_subnorm_value, UNDERFLOW_EXCEPTION);
+#if !(defined TEST_LDOUBLE && LDBL_MANT_DIG == 106) /* Bug 13304. */
TEST_fff_f (fma, max_value, max_value, min_value, plus_infty, OVERFLOW_EXCEPTION);
TEST_fff_f (fma, max_value, max_value, -min_value, plus_infty, OVERFLOW_EXCEPTION);
TEST_fff_f (fma, max_value, -max_value, min_value, -max_value, OVERFLOW_EXCEPTION);
@@ -5341,6 +5359,7 @@ fma_test_upward (void)
TEST_fff_f (fma, -max_value, max_value, -min_value, -max_value, OVERFLOW_EXCEPTION);
TEST_fff_f (fma, -max_value, -max_value, min_value, plus_infty, OVERFLOW_EXCEPTION);
TEST_fff_f (fma, -max_value, -max_value, -min_value, plus_infty, OVERFLOW_EXCEPTION);
+#endif
#if defined (TEST_FLOAT) && FLT_MANT_DIG == 24
TEST_fff_f (fma, 0x1.4p-126, 0x1.000004p-1, 0x1p-128, 0x1.c00008p-127, UNDERFLOW_EXCEPTION);
@@ -5738,6 +5757,11 @@ hypot_test (void)
TEST_ff_f (hypot, 0.75L, 1.25L, 1.45773797371132511771853821938639577L);
+ TEST_ff_f (hypot, 1.0L, 0x1p-61L, 1.0L);
+#if defined TEST_LDOUBLE && LDBL_MANT_DIG >= 106
+ TEST_ff_f (hypot, 0x1.23456789abcdef0123456789ab8p-500L, 0x1.23456789abcdef0123456789ab8p-500L, 4.9155782399407039128612180934736799735113e-151L);
+#endif
+
#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);
@@ -8420,7 +8444,6 @@ pow_test (void)
#endif
TEST_ff_f (pow, -min_value, max_value, plus_zero, UNDERFLOW_EXCEPTION);
-#ifndef TEST_LDOUBLE /* Bug 13881. */
TEST_ff_f (pow, 0x0.ffffffp0, 10, 0.999999403953712118183885036774764444747L);
TEST_ff_f (pow, 0x0.ffffffp0, 100, 0.999994039553108359406305079606228341585L);
TEST_ff_f (pow, 0x0.ffffffp0, 1000, 0.9999403971297699052276650144650733772182L);
@@ -8436,16 +8459,44 @@ pow_test (void)
TEST_ff_f (pow, 0x1.000002p0, 0x1p24, 7.3890552180866447284268641248075832310141L);
TEST_ff_f (pow, 0x1.000002p0, 0x1.234566p29, 4.2107033006507495188536371520637025716256e+31L);
TEST_ff_f (pow, 0x1.000002p0, -0x1.234566p29, 2.3749001736727769098946062325205705312166e-32L);
-#endif
- /* Bug 13881: powl inaccurate so these tests disabled for long double. */
-#if !defined TEST_FLOAT && !defined TEST_LDOUBLE
+#if !defined TEST_FLOAT
TEST_ff_f (pow, 0x0.fffffffffffff8p0L, 0x1.23456789abcdfp62L, 1.0118762747827252817436395051178295138220e-253L);
TEST_ff_f (pow, 0x0.fffffffffffff8p0L, -0x1.23456789abcdfp62L, 9.8826311568054561811190162420900667121992e+252L);
TEST_ff_f (pow, 0x1.0000000000001p0L, 0x1.23456789abcdfp61L, 9.8826311568044974397135026217687399395481e+252L);
TEST_ff_f (pow, 0x1.0000000000001p0L, -0x1.23456789abcdfp61L, 1.0118762747828234466621210689458255908670e-253L);
#endif
+#if defined TEST_LDOUBLE && LDBL_MANT_DIG >= 64 && LDBL_MAX_EXP >= 16384
+ TEST_ff_f (pow, 0x0.ffffffffffffffffp0L, 0x1.23456789abcdef0ep77L, 1.2079212226420368189981778807634890018840e-4048L);
+ TEST_ff_f (pow, 0x0.ffffffffffffffffp0L, -0x1.23456789abcdef0ep77L, 8.2786855736563746280496724205839522148001e+4047L);
+ TEST_ff_f (pow, 0x1.0000000000000002p0L, 0x1.23456789abcdef0ep76L, 8.2786855736563683535324500168799315131570e+4047L);
+ TEST_ff_f (pow, 0x1.0000000000000002p0L, -0x1.23456789abcdef0ep76L, 1.2079212226420377344964713407722652880280e-4048L);
+#endif
+
+#if defined TEST_LDOUBLE && LDBL_MANT_DIG >= 113
+ TEST_ff_f (pow, 0x0.ffffffffffffffffffffffffffff8p0L, 0x1.23456789abcdef0123456789abcdp126L, 1.2079212226420440237790185999151440179953e-4048L);
+ TEST_ff_f (pow, 0x0.ffffffffffffffffffffffffffff8p0L, -0x1.23456789abcdef0123456789abcdp126L, 8.2786855736563252489063231915535105363602e+4047L);
+ TEST_ff_f (pow, 0x1.0000000000000000000000000001p0L, 0x1.23456789abcdef0123456789abcdp125L, 8.2786855736563252489063231915423647547782e+4047L);
+ TEST_ff_f (pow, 0x1.0000000000000000000000000001p0L, -0x1.23456789abcdef0123456789abcdp125L, 1.2079212226420440237790185999167702696503e-4048L);
+#endif
+
+#if defined TEST_LDOUBLE && LDBL_MAX_EXP >= 16384
+ TEST_ff_f (pow, 1e4932L, 0.75L, 1e3699L);
+ TEST_ff_f (pow, 1e4928L, 0.75L, 1e3696L);
+ TEST_ff_f (pow, 1e4924L, 0.75L, 1e3693L);
+ TEST_ff_f (pow, 1e4920L, 0.75L, 1e3690L);
+ TEST_ff_f (pow, 10.0L, 4932.0L, 1e4932L);
+ TEST_ff_f (pow, 10.0L, 4931.0L, 1e4931L);
+ TEST_ff_f (pow, 10.0L, 4930.0L, 1e4930L);
+ TEST_ff_f (pow, 10.0L, 4929.0L, 1e4929L);
+ TEST_ff_f (pow, 10.0L, -4931.0L, 1e-4931L);
+ TEST_ff_f (pow, 10.0L, -4930.0L, 1e-4930L);
+ TEST_ff_f (pow, 10.0L, -4929.0L, 1e-4929L);
+ TEST_ff_f (pow, 1e27L, 182.0L, 1e4914L);
+ TEST_ff_f (pow, 1e27L, -182.0L, 1e-4914L);
+#endif
+
TEST_ff_f (pow, min_subnorm_value, min_subnorm_value, 1.0L);
TEST_ff_f (pow, min_subnorm_value, -min_subnorm_value, 1.0L);
TEST_ff_f (pow, max_value, min_subnorm_value, 1.0L);
@@ -10211,6 +10262,18 @@ y0_test (void)
TEST_f_f (y0, 0x1.ff00000000002p+840L, 1.846591691699331493194965158699937660696e-127L, UNDERFLOW_EXCEPTION_OK);
#endif
+ TEST_f_f (y0, 0x1p-10L, -4.4865150767109739412411806297168793661098L);
+ TEST_f_f (y0, 0x1p-20L, -8.8992283012125827603076426611387876938160L);
+ TEST_f_f (y0, 0x1p-30L, -1.3311940304267782826037118027401817264906e+1L);
+ TEST_f_f (y0, 0x1p-40L, -1.7724652307320814696990854700366226762563e+1L);
+ TEST_f_f (y0, 0x1p-50L, -2.2137364310373846564919987139743760738155e+1L);
+ TEST_f_f (y0, 0x1p-60L, -2.6550076313426878432849115782108205929120e+1L);
+ TEST_f_f (y0, 0x1p-70L, -3.0962788316479910300778244424468159753887e+1L);
+ TEST_f_f (y0, 0x1p-80L, -3.5375500319532942168707373066828113573541e+1L);
+ TEST_f_f (y0, 0x1p-90L, -3.9788212322585974036636501709188067393195e+1L);
+ TEST_f_f (y0, 0x1p-100L, -4.420092432563900590456563035154802121284e+1L);
+ TEST_f_f (y0, 0x1p-110L, -4.861363632869203777249475899390797503250e+1L);
+
END (y0);
}
@@ -10254,6 +10317,18 @@ y1_test (void)
TEST_f_f (y1, 0x1.001000001p+593L, 3.927269966354206207832593635798954916263e-90L, UNDERFLOW_EXCEPTION_OK);
#endif
+ TEST_f_f (y1, 0x1p-10L, -6.5190099301063115047395187618929589514382e+02L);
+ TEST_f_f (y1, 0x1p-20L, -6.6754421443450423911167962313100637952285e+05L);
+ TEST_f_f (y1, 0x1p-30L, -6.8356527557643159612937462812258975438856e+08L);
+ TEST_f_f (y1, 0x1p-40L, -6.9997084219026594793707805777425993547887e+11L);
+ TEST_f_f (y1, 0x1p-50L, -7.1677014240283233068755952926181262431559e+14L);
+ TEST_f_f (y1, 0x1p-60L, -7.3397262582050030662406095795388448059822e+17L);
+ TEST_f_f (y1, 0x1p-70L, -7.5158796884019231398303842094477769620063e+20L);
+ TEST_f_f (y1, 0x1p-80L, -7.6962608009235692951863134304745236090943e+23L);
+ TEST_f_f (y1, 0x1p-90L, -7.8809710601457349582707849528059121757126e+26L);
+ TEST_f_f (y1, 0x1p-100L, -8.0701143655892325972692837916732540679297e+29L);
+ TEST_f_f (y1, 0x1p-110L, -8.2637971103633741796037466026734121655600e+32L);
+
END (y1);
}
diff --git a/libc/nptl/ChangeLog b/libc/nptl/ChangeLog
index 48aa6da1a..a9b00e7c7 100644
--- a/libc/nptl/ChangeLog
+++ b/libc/nptl/ChangeLog
@@ -1,3 +1,24 @@
+2012-11-26 H.J. Lu <hongjiu.lu@intel.com>
+
+ * unwind.c (__pthread_unwind): Pass address of unwind_cleanup
+ to THREAD_SETMEM.
+ * sysdeps/i386/tls.h: Include <libc-internal.h>.
+ (THREAD_SETMEM): Use cast_to_integer before casting to uint64_t.
+ (THREAD_SETMEM_NC): Likewise.
+ * sysdeps/x86_64/tls.h: Include <libc-internal.h>.
+ (THREAD_SETMEM): Use cast_to_integer before casting to uint64_t.
+ (THREAD_SETMEM_NC): Likewise.
+
+2012-11-21 Joseph Myers <joseph@codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/sem_post.c (__old_sem_post): Cast result
+ of atomic_increment_val to (void) instead of storing in
+ otherwise-unused variable.
+
+ * pthread_cond_timedwait.c (__pthread_cond_timedwait)
+ [__NR_clock_gettime]: Cast result of INTERNAL_VSYSCALL to void
+ instead of storing in otherwise-unused variable.
+
2012-11-14 Marcus Shawcroft <marcus.shawcroft@linaro.org>
* Makefile (CFLAGS-open.c, CFLAGS-open64.c, CFLAGS-pause.c)
diff --git a/libc/nptl/pthread_cond_timedwait.c b/libc/nptl/pthread_cond_timedwait.c
index 2fcbc57c2..ef33b966b 100644
--- a/libc/nptl/pthread_cond_timedwait.c
+++ b/libc/nptl/pthread_cond_timedwait.c
@@ -115,11 +115,10 @@ __pthread_cond_timedwait (cond, mutex, abstime)
{
# ifdef __NR_clock_gettime
INTERNAL_SYSCALL_DECL (err);
- int ret;
- ret = INTERNAL_VSYSCALL (clock_gettime, err, 2,
- (cond->__data.__nwaiters
- & ((1 << COND_NWAITERS_SHIFT) - 1)),
- &rt);
+ (void) INTERNAL_VSYSCALL (clock_gettime, err, 2,
+ (cond->__data.__nwaiters
+ & ((1 << COND_NWAITERS_SHIFT) - 1)),
+ &rt);
/* Convert the absolute timeout value to a relative timeout. */
rt.tv_sec = abstime->tv_sec - rt.tv_sec;
rt.tv_nsec = abstime->tv_nsec - rt.tv_nsec;
diff --git a/libc/nptl/sysdeps/i386/tls.h b/libc/nptl/sysdeps/i386/tls.h
index eb1ca312f..90c7a534b 100644
--- a/libc/nptl/sysdeps/i386/tls.h
+++ b/libc/nptl/sysdeps/i386/tls.h
@@ -26,6 +26,7 @@
# include <stdint.h>
# include <stdlib.h>
# include <sysdep.h>
+# include <libc-internal.h>
# include <kernel-features.h>
@@ -343,7 +344,7 @@ union user_desc_init
\
asm volatile ("movl %%eax,%%gs:%P1\n\t" \
"movl %%edx,%%gs:%P2" : \
- : "A" ((uint64_t) (value)), \
+ : "A" ((uint64_t) cast_to_integer (value)), \
"i" (offsetof (struct pthread, member)), \
"i" (offsetof (struct pthread, member) + 4)); \
}})
@@ -370,7 +371,7 @@ union user_desc_init
\
asm volatile ("movl %%eax,%%gs:%P1(,%2,8)\n\t" \
"movl %%edx,%%gs:4+%P1(,%2,8)" : \
- : "A" ((uint64_t) (value)), \
+ : "A" ((uint64_t) cast_to_integer (value)), \
"i" (offsetof (struct pthread, member)), \
"r" (idx)); \
}})
diff --git a/libc/nptl/sysdeps/unix/sysv/linux/sem_post.c b/libc/nptl/sysdeps/unix/sysv/linux/sem_post.c
index 67e8cc542..429d1932f 100644
--- a/libc/nptl/sysdeps/unix/sysv/linux/sem_post.c
+++ b/libc/nptl/sysdeps/unix/sysv/linux/sem_post.c
@@ -65,7 +65,7 @@ __old_sem_post (sem_t *sem)
{
int *futex = (int *) sem;
- int nr = atomic_increment_val (futex);
+ (void) atomic_increment_val (futex);
/* We always have to assume it is a shared semaphore. */
int err = lll_futex_wake (futex, 1, LLL_SHARED);
if (__builtin_expect (err, 0) < 0)
diff --git a/libc/nptl/sysdeps/x86_64/tls.h b/libc/nptl/sysdeps/x86_64/tls.h
index bc60a511f..f3b76495b 100644
--- a/libc/nptl/sysdeps/x86_64/tls.h
+++ b/libc/nptl/sysdeps/x86_64/tls.h
@@ -26,6 +26,7 @@
# include <stdint.h>
# include <stdlib.h>
# include <sysdep.h>
+# include <libc-internal.h>
# include <kernel-features.h>
/* Replacement type for __m128 since this file is included by ld.so,
@@ -263,7 +264,7 @@ typedef struct
abort (); \
\
asm volatile ("movq %q0,%%fs:%P1" : \
- : IMM_MODE ((uint64_t) (value)), \
+ : IMM_MODE ((uint64_t) cast_to_integer (value)), \
"i" (offsetof (struct pthread, member))); \
}})
@@ -288,7 +289,7 @@ typedef struct
abort (); \
\
asm volatile ("movq %q0,%%fs:%P1(,%q2,8)" : \
- : IMM_MODE ((uint64_t) (value)), \
+ : IMM_MODE ((uint64_t) cast_to_integer (value)), \
"i" (offsetof (struct pthread, member[0])), \
"r" (idx)); \
}})
diff --git a/libc/nptl/unwind.c b/libc/nptl/unwind.c
index 7ccb21382..aedd03745 100644
--- a/libc/nptl/unwind.c
+++ b/libc/nptl/unwind.c
@@ -124,7 +124,7 @@ __pthread_unwind (__pthread_unwind_buf_t *buf)
/* This is not a catchable exception, so don't provide any details about
the exception type. We do need to initialize the field though. */
THREAD_SETMEM (self, exc.exception_class, 0);
- THREAD_SETMEM (self, exc.exception_cleanup, unwind_cleanup);
+ THREAD_SETMEM (self, exc.exception_cleanup, &unwind_cleanup);
_Unwind_ForcedUnwind (&self->exc, unwind_stop, ibuf);
#else
diff --git a/libc/nptl_db/ChangeLog b/libc/nptl_db/ChangeLog
index 417514978..bded2fe18 100644
--- a/libc/nptl_db/ChangeLog
+++ b/libc/nptl_db/ChangeLog
@@ -1,3 +1,7 @@
+2012-11-23 Mike Frysinger <vapier@gentoo.org>
+
+ * Makefile ($(objpfx)db-symbols.out): Change readelf to $(READELF).
+
2012-10-08 Jonathan Nieder <jrnieder@gmail.com>
[BZ #14661]
diff --git a/libc/nptl_db/Makefile b/libc/nptl_db/Makefile
index 6ccb3d0cc..54721e7b6 100644
--- a/libc/nptl_db/Makefile
+++ b/libc/nptl_db/Makefile
@@ -60,6 +60,6 @@ $(objpfx)libthread_db.so: $(common-objpfx)libc.so \
tests: $(objpfx)db-symbols.out
$(objpfx)db-symbols.out: $(objpfx)db-symbols.v.i \
$(common-objpfx)nptl/libpthread.so
- LC_ALL=C readelf -W -s $(filter %.so,$^) | $(AWK) -f $< > $@
+ LC_ALL=C $(READELF) -W -s $(filter %.so,$^) | $(AWK) -f $< > $@
$(objpfx)db-symbols.v.i: db-symbols.awk
diff --git a/libc/nscd/grpcache.c b/libc/nscd/grpcache.c
index d09badfac..f0dad4d54 100644
--- a/libc/nscd/grpcache.c
+++ b/libc/nscd/grpcache.c
@@ -177,7 +177,8 @@ cache_addgr (struct database_dyn *db, int fd, request_header *req,
char *cp;
const size_t key_len = strlen (key);
const size_t buf_len = 3 * sizeof (grp->gr_gid) + key_len + 1;
- char *buf = alloca (buf_len);
+ size_t alloca_used = 0;
+ char *buf = alloca_account (buf_len, alloca_used);
ssize_t n;
size_t cnt;
@@ -189,7 +190,7 @@ cache_addgr (struct database_dyn *db, int fd, request_header *req,
/* Determine the length of all members. */
while (grp->gr_mem[gr_mem_cnt])
++gr_mem_cnt;
- gr_mem_len = (uint32_t *) alloca (gr_mem_cnt * sizeof (uint32_t));
+ gr_mem_len = alloca_account (gr_mem_cnt * sizeof (uint32_t), alloca_used);
for (gr_mem_cnt = 0; grp->gr_mem[gr_mem_cnt]; ++gr_mem_cnt)
{
gr_mem_len[gr_mem_cnt] = strlen (grp->gr_mem[gr_mem_cnt]) + 1;
@@ -204,7 +205,8 @@ cache_addgr (struct database_dyn *db, int fd, request_header *req,
change. Allocate memory on the cache since it is likely
discarded anyway. If it turns out to be necessary to have a
new record we can still allocate real memory. */
- bool alloca_used = false;
+ bool dataset_temporary = false;
+ bool dataset_malloced = false;
dataset = NULL;
if (he == NULL)
@@ -215,10 +217,20 @@ cache_addgr (struct database_dyn *db, int fd, request_header *req,
/* We cannot permanently add the result in the moment. But
we can provide the result as is. Store the data in some
temporary memory. */
- dataset = (struct dataset *) alloca (total + n);
+ if (! __libc_use_alloca (alloca_used + total + n))
+ {
+ dataset = malloc (total + n);
+ /* Perhaps we should log a message that we were unable
+ to allocate memory for a large request. */
+ if (dataset == NULL)
+ goto out;
+ dataset_malloced = true;
+ }
+ else
+ dataset = alloca_account (total + n, alloca_used);
/* We cannot add this record to the permanent database. */
- alloca_used = true;
+ dataset_temporary = true;
}
dataset->head.allocsize = total + n;
@@ -272,6 +284,11 @@ cache_addgr (struct database_dyn *db, int fd, request_header *req,
allocated on the stack and need not be freed. */
dh->timeout = dataset->head.timeout;
++dh->nreloads;
+
+ /* If the new record was allocated via malloc, then we must free
+ it here. */
+ if (dataset_malloced)
+ free (dataset);
}
else
{
@@ -287,7 +304,7 @@ cache_addgr (struct database_dyn *db, int fd, request_header *req,
key_copy = (char *) newp + (key_copy - (char *) dataset);
dataset = memcpy (newp, dataset, total + n);
- alloca_used = false;
+ dataset_temporary = false;
}
/* Mark the old record as obsolete. */
@@ -302,7 +319,7 @@ cache_addgr (struct database_dyn *db, int fd, request_header *req,
assert (fd != -1);
#ifdef HAVE_SENDFILE
- if (__builtin_expect (db->mmap_used, 1) && !alloca_used)
+ if (__builtin_expect (db->mmap_used, 1) && ! dataset_temporary)
{
assert (db->wr_fd != -1);
assert ((char *) &dataset->resp > (char *) db->data);
@@ -329,7 +346,7 @@ cache_addgr (struct database_dyn *db, int fd, request_header *req,
/* Add the record to the database. But only if it has not been
stored on the stack. */
- if (! alloca_used)
+ if (! dataset_temporary)
{
/* If necessary, we also propagate the data to disk. */
if (db->persistent)
diff --git a/libc/nss/getXXbyYY_r.c b/libc/nss/getXXbyYY_r.c
index 8b3b61b66..885b53b60 100644
--- a/libc/nss/getXXbyYY_r.c
+++ b/libc/nss/getXXbyYY_r.c
@@ -284,7 +284,12 @@ done:
#endif
*result = status == NSS_STATUS_SUCCESS ? resbuf : NULL;
#ifdef NEED_H_ERRNO
- if (status != NSS_STATUS_SUCCESS && ! any_service)
+ if (status == NSS_STATUS_UNAVAIL)
+ /* Either we failed to lookup the functions or the functions themselves
+ had a system error. Set NETDB_INTERNAL here to let the caller know
+ that the errno may have the real reason for failure. */
+ *h_errnop = NETDB_INTERNAL;
+ else if (status != NSS_STATUS_SUCCESS && !any_service)
/* We were not able to use any service. */
*h_errnop = NO_RECOVERY;
#endif
diff --git a/libc/nss/makedb.c b/libc/nss/makedb.c
index 8d7d027b7..e372f5d77 100644
--- a/libc/nss/makedb.c
+++ b/libc/nss/makedb.c
@@ -591,13 +591,16 @@ copy_valstr (const void *nodep, const VISIT which, const int depth)
}
+/* Determine if the candidate is prime by using a modified trial division
+ algorithm. The candidate must be both odd and greater than 4. */
static int
is_prime (size_t candidate)
{
- /* No even number and none less than 10 will be passed here. */
size_t divn = 3;
size_t sq = divn * divn;
+ assert (candidate > 4 && candidate % 2 != 0);
+
while (sq < candidate && candidate % divn != 0)
{
++divn;
@@ -612,8 +615,8 @@ is_prime (size_t candidate)
static size_t
next_prime (size_t seed)
{
- /* Make it definitely odd. */
- seed |= 1;
+ /* Make sure that we're always greater than 4. */
+ seed = (seed + 4) | 1;
while (!is_prime (seed))
seed += 2;
diff --git a/libc/ports/ChangeLog.aarch64 b/libc/ports/ChangeLog.aarch64
index 58f6fd014..eac41e501 100644
--- a/libc/ports/ChangeLog.aarch64
+++ b/libc/ports/ChangeLog.aarch64
@@ -1,3 +1,133 @@
+2012-11-29 Steve McIntyre <steve.mcintyre@linaro.org>
+
+ * sysdeps/unix/sysv/linux/aarch64/dl-cache.h: New file.
+
+2012-11-22 Marcus Shawcroft <marcus.shawcroft@linaro.org>
+
+ * sysdeps/aarch64/libm-test-ulps: Regenerate.
+
+2012-11-21 Marcus Shawcroft <marcus.shawcroft@linaro.org>
+
+ * sysdeps/unix/sysv/linux/aarch64/nptl/lowlevellock.h
+ (lll_futex_timed_wait_bitset): Remove INTERNAL_SYSCALL_ERROR_P.
+
+2012-11-20 Marcus Shawcroft <marcus.shawcroft@linaro.org>
+
+ * sysdeps/aarch64/fpu/s_fma.c (weak_alias_x):
+ Remove and switch to weak_alias.
+ * sysdeps/aarch64/fpu/s_fmin.c (weak_alias_x): Likewise.
+ * sysdeps/aarch64/fpu/s_frint.c (weak_alias_x): Likewise.
+ * sysdeps/aarch64/fpu/s_lrint.c (weak_alias_x): Likewise.
+ * sysdeps/aarch64/fpu/s_lround.c (weak_alias_x): Likewise.
+
+2012-11-20 Marcus Shawcroft <marcus.shawcroft@linaro.org>
+
+ * sysdeps/aarch64/fpu/s_fma.c (strong_aliasx, NO_LONG_DOUBLE): Remove.
+ * sysdeps/aarch64/fpu/s_fmin.c (strong_aliasx, NO_LONG_DOUBLE): Likewise.
+ * sysdeps/aarch64/fpu/s_frint.c (strong_aliasx, NO_LONG_DOUBLE): Likewise.
+ * sysdeps/aarch64/fpu/s_lrint.c (strong_aliasx, NO_LONG_DOUBLE): Likewise.
+ * sysdeps/aarch64/fpu/s_lround.c (strong_aliasx, NO_LONG_DOUBLE): Likewise.
+
+2012-11-20 Marcus Shawcroft <marcus.shawcroft@linaro.org>
+
+ * sysdeps/aarch64/fpu/s_fma.c: Indent preprocessor directives.
+ * sysdeps/aarch64/fpu/s_fmin.c: Likewise.
+ * sysdeps/aarch64/fpu/s_frint.c: Likewise.
+ * sysdeps/aarch64/fpu/s_frintf.c: Likewise.
+ * sysdeps/aarch64/fpu/s_lrint.c: Likewise.
+ * sysdeps/aarch64/fpu/s_lround.c: Likewise.
+
+2012-11-20 Marcus Shawcroft <marcus.shawcroft@linaro.org>
+
+ * sysdeps/aarch64/dl-tlsdesc.S: Use range for copyright years.
+ * sysdeps/aarch64/dl-tlsdesc.h: Likewise.
+ * sysdeps/aarch64/tlsdesc.c: Likewise.
+ * sysdeps/aarch64/fpu/s_ceil.c: Likewise.
+ * sysdeps/aarch64/fpu/s_ceilf.c: Likewise.
+ * sysdeps/aarch64/fpu/s_floor.c: Likewise.
+ * sysdeps/aarch64/fpu/s_floorf.c: Likewise.
+ * sysdeps/aarch64/fpu/s_fmaf.c: Likewise.
+ * sysdeps/aarch64/fpu/s_fmax.c: Likewise.
+ * sysdeps/aarch64/fpu/s_fmaxf.c: Likewise.
+ * sysdeps/aarch64/fpu/s_fmin.c: Likewise.
+ * sysdeps/aarch64/fpu/s_fminf.c: Likewise.
+ * sysdeps/aarch64/fpu/s_frint.c: Likewise.
+ * sysdeps/aarch64/fpu/s_frintf.c: Likewise.
+ * sysdeps/aarch64/fpu/s_llrint.c: Likewise.
+ * sysdeps/aarch64/fpu/s_llrintf.c: Likewise.
+ * sysdeps/aarch64/fpu/s_llround.c: Likewise.
+ * sysdeps/aarch64/fpu/s_llroundf.c: Likewise.
+ * sysdeps/aarch64/fpu/s_lrint.c: Likewise.
+ * sysdeps/aarch64/fpu/s_lrintf.c: Likewise.
+ * sysdeps/aarch64/fpu/s_lround.c: Likewise.
+ * sysdeps/aarch64/fpu/s_lroundf.c: Likewise.
+ * sysdeps/aarch64/fpu/s_nearbyint.c: Likewise.
+ * sysdeps/aarch64/fpu/s_nearbyintf.c: Likewise.
+ * sysdeps/aarch64/fpu/s_rint.c: Likewise.
+ * sysdeps/aarch64/fpu/s_rintf.c: Likewise.
+ * sysdeps/aarch64/fpu/s_round.c: Likewise.
+ * sysdeps/aarch64/fpu/s_roundf.c: Likewise.
+ * sysdeps/aarch64/fpu/s_trunc.c: Likewise.
+ * sysdeps/aarch64/fpu/s_truncf.c: Likewise.
+
+2012-11-20 Marcus Shawcroft <marcus.shawcroft@linaro.org>
+
+ * sysdeps/aarch64/fpu/s_frint.x: Renamed to...
+ * sysdeps/aarch64/fpu/s_frint.c: ... this new file.
+ * sysdeps/aarch64/fpu/s_frintf.x: Renamed to...
+ * sysdeps/aarch64/fpu/s_frintf.c: ... this new file.
+ * sysdeps/aarch64/fpu/s_ceil.c: Include s_frint.c.
+ * sysdeps/aarch64/fpu/s_floor.c: Likewise.
+ * sysdeps/aarch64/fpu/s_nearbyint.c: Likewise.
+ * sysdeps/aarch64/fpu/s_rint.c: Likewise.
+ * sysdeps/aarch64/fpu/s_round.c: Likewise.
+ * sysdeps/aarch64/fpu/s_trunc.c: Likewise.
+ * sysdeps/aarch64/fpu/s_ceilf.c: Include s_frintf.c.
+ * sysdeps/aarch64/fpu/s_floorf.c: Likewise.
+ * sysdeps/aarch64/fpu/s_nearbyintf.c: Likewise.
+ * sysdeps/aarch64/fpu/s_rintf.c: Likewise.
+ * sysdeps/aarch64/fpu/s_roundf.c: Likewise.
+ * sysdeps/aarch64/fpu/s_truncf.c: Likewise.
+
+2012-11-20 Marcus Shawcroft <marcus.shawcroft@linaro.org>
+
+ * sysdeps/aarch64/fpu/s_fma.c (__CONCATX): Don't use K&R.
+ * sysdeps/aarch64/fpu/s_fmin.c (__CONCATX): Likewise.
+ * sysdeps/aarch64/fpu/s_lrint.c (__CONCATX): Likewise.
+ * sysdeps/aarch64/fpu/s_lround.c (__CONCATX): Likewise.
+ * sysdeps/aarch64/fpu/s_frint.x (__CONCATX): Likewise.
+
+2012-11-19 Marcus Shawcroft <marcus.shawcroft@linaro.org>
+
+ * sysdeps/aarch64/fpu/s_ceil.c: New file.
+ * sysdeps/aarch64/fpu/s_ceilf.c: New file.
+ * sysdeps/aarch64/fpu/s_floor.c: New file.
+ * sysdeps/aarch64/fpu/s_floorf.c: New file.
+ * sysdeps/aarch64/fpu/s_fma.c: Replace file.
+ * sysdeps/aarch64/fpu/s_fmaf.c: New file.
+ * sysdeps/aarch64/fpu/s_fmax.c: New file.
+ * sysdeps/aarch64/fpu/s_fmaxf.c: New file.
+ * sysdeps/aarch64/fpu/s_fmin.c: New file.
+ * sysdeps/aarch64/fpu/s_fminf.c: New file.
+ * sysdeps/aarch64/fpu/s_frint.x: New file.
+ * sysdeps/aarch64/fpu/s_frintf.x: New file.
+ * sysdeps/aarch64/fpu/s_llrint.c: New file.
+ * sysdeps/aarch64/fpu/s_llrintf.c: New file.
+ * sysdeps/aarch64/fpu/s_llround.c: New file.
+ * sysdeps/aarch64/fpu/s_llroundf.c: New file.
+ * sysdeps/aarch64/fpu/s_lrint.c: New file.
+ * sysdeps/aarch64/fpu/s_lrintf.c: New file.
+ * sysdeps/aarch64/fpu/s_lround.c: New file.
+ * sysdeps/aarch64/fpu/s_lroundf.c: New file.
+ * sysdeps/aarch64/fpu/s_nearbyint.c: New file.
+ * sysdeps/aarch64/fpu/s_nearbyintf.c: New file.
+ * sysdeps/aarch64/fpu/s_rint.c: New file.
+ * sysdeps/aarch64/fpu/s_rintf.c: New file.
+ * sysdeps/aarch64/fpu/s_round.c: New file.
+ * sysdeps/aarch64/fpu/s_roundf.c: New file.
+ * sysdeps/aarch64/fpu/s_trunc.c: New file.
+ * sysdeps/aarch64/fpu/s_truncf.c: New file.
+
2012-11-09 Marcus Shawcroft <marcus.shawcroft@linaro.org>
* sysdeps/aarch64/Implies: New file.
diff --git a/libc/ports/ChangeLog.alpha b/libc/ports/ChangeLog.alpha
index ca446c8a8..210453b92 100644
--- a/libc/ports/ChangeLog.alpha
+++ b/libc/ports/ChangeLog.alpha
@@ -1,3 +1,9 @@
+2012-11-30 Richard Henderson <rth@redhat.com>
+
+ * sysdeps/alpha/fpu/libm-test-ulps: Update.
+
+ * sysdeps/alpha/sotruss-lib.c: New file.
+
2012-11-03 Joseph Myers <joseph@codesourcery.com>
* sysdeps/alpha/fpu/fclrexcpt.c (feclearexcept): Add
diff --git a/libc/ports/ChangeLog.arm b/libc/ports/ChangeLog.arm
index d06012131..d28d28a44 100644
--- a/libc/ports/ChangeLog.arm
+++ b/libc/ports/ChangeLog.arm
@@ -1,3 +1,20 @@
+2012-11-30 Joseph Myers <joseph@codesourcery.com>
+
+ * sysdeps/arm/libm-test-ulps: Update.
+
+2012-11-21 Joseph Myers <joseph@codesourcery.com>
+
+ * sysdeps/arm/configure.in: Generate default-abi.make with
+ definition of default-abi.
+ * sysdeps/arm/configure: Regenerated.
+ * sysdeps/unix/sysv/linux/arm/Makefile (default-abi-prog): Remove.
+ (default-abi): Likewise.
+ ($(common-objpfx)default-abi.make): Include.
+
+ [BZ #14866]
+ * sysdeps/arm/fesetenv.c (__fesetenv): Test whether bits for
+ trapping exceptions were successfully set for FE_NOMASK_ENV.
+
2012-11-14 Marcus Shawcroft <marcus.shawcroft@linaro.org>
* sysdeps/unix/sysv/linux/arm/Makefile (libcrypt-sysdep_routines): Add
diff --git a/libc/ports/ChangeLog.hppa b/libc/ports/ChangeLog.hppa
index 201dd01de..222ee443a 100644
--- a/libc/ports/ChangeLog.hppa
+++ b/libc/ports/ChangeLog.hppa
@@ -1,3 +1,31 @@
+2012-11-29 Carlos O'Donell <carlos@systemhalted.org>
+
+ * sysdeps/unix/sysv/linux/hppa/bits/socket.h: Delete file.
+ * sysdeps/unix/sysv/linux/hppa/bits/socket_type.h: New file.
+
+ * sysdeps/hppa/fpu/feholdexcpt.c: Cast return to unsigned long long *.
+ * sysdeps/unix/sysv/linux/hppa/mmap.c: Cast return to __ptr_t.
+
+2012-11-19 Mike Frysinger <vapier@gentoo.org>
+
+ * sysdeps/unix/sysv/linux/hppa/nptl/pthread_once.c: Replace _internal
+ alias by hidden_def.
+
+2012-11-18 Carlos O'Donell <carlos@systemhalted.org>
+
+ * sysdeps/hppa/fpu/fesetenv.c: Reset FPU to default for FE_DFL_ENV.
+
+ * sysdeps/hppa/get-rounding-mode.h: New file.
+ * sysdeps/hppa/fpu/fegetround.c: Use get_rounding_mode.
+
+ * ports/sysdeps/hppa/fpu/fpu_control.h: New file.
+
+ * ports/sysdeps/hppa/__longjmp.S: Removed.
+ * ports/sysdeps/hppa/__longjmp.c: New file.
+ * ports/sysdeps/unix/sysv/linux/hppa/____longjmp_chk.c: New file.
+ * ports/sysdeps/hppa/bits/setjmp.h: Use union for __jmp_buf.
+ * ports/sysdeps/hppa/setjmp.S: Comment byte offsets and padding.
+
2012-11-05 Joseph Myers <joseph@codesourcery.com>
[BZ #14805]
@@ -30,6 +58,7 @@
2012-10-29 Carlos O'Donell <carlos@systemhalted.org>
+ [BZ #14447]
* sysdeps/unix/sysv/linux/hppa/sysdep.h (ENTRY): Add cfi_startproc.
Use .cfi_offset for rp store.
(ENTRY_LEAF): Likewise.
@@ -197,7 +226,7 @@
2012-03-03 Carlos O'Donell <carlos@systemhalted.org>
- * sysdeps/unix/sysv/linux/hppa/nptl/bits/pthreadtypes.h: Name
+ * sysdeps/unix/sysv/linux/hppa/nptl/bits/pthreadtypes.h: Name
pthread_attr_t union.
* sysdeps/unix/sysv/linux/hppa/nptl/pthread.h: Sync from libc copy.
* sysdeps/unix/sysv/linux/hppa/bits/socket.h: Likewise.
@@ -219,12 +248,12 @@
2011-10-21 Carlos O'Donell <carlos@systemhalted.org>
* sysdeps/unix/sysv/linux/hppa/sys/procfs.h: Update copyright year.
- Do not include signal.h and sys/ucontext.h.
+ Do not include signal.h and sys/ucontext.h.
2011-10-20 Carlos O'Donell <carlos@systemhalted.org>
- * sysdeps/unix/sysv/linux/hppa/nptl/sysdep-cancel.h: Update copyright
- year.
+ * sysdeps/unix/sysv/linux/hppa/nptl/sysdep-cancel.h: Update copyright
+ year.
(PSEUDO): Define __*_nocancel version. Add CFI directives to __*_nocancel
and normal version.
(PUSHARGS_1): Add CFI directive.
diff --git a/libc/ports/ChangeLog.ia64 b/libc/ports/ChangeLog.ia64
index 0b3361af0..d886cf4ec 100644
--- a/libc/ports/ChangeLog.ia64
+++ b/libc/ports/ChangeLog.ia64
@@ -1,3 +1,7 @@
+2012-11-29 Mike Frysinger <vapier@gentoo.org>
+
+ * sysdeps/unix/sysv/linux/ia64/clock_getcpuclockid.c: Delete.
+
2012-11-03 Joseph Myers <joseph@codesourcery.com>
* sysdeps/ia64/fpu/fclrexcpt.c (feclearexcept): Add
diff --git a/libc/ports/ChangeLog.m68k b/libc/ports/ChangeLog.m68k
index 206702e1f..b34c4ba54 100644
--- a/libc/ports/ChangeLog.m68k
+++ b/libc/ports/ChangeLog.m68k
@@ -1,3 +1,56 @@
+2012-11-30 Andreas Schwab <schwab@linux-m68k.org>
+
+ * sysdeps/m68k/m680x0/fpu/libm-test-ulps: Update.
+
+2012-11-23 Andreas Schwab <schwab@linux-m68k.org>
+
+ * sysdeps/m68k/dl-trampoline.S (_dl_runtime_profile)
+ [__mcoldfire__]: Fix copying loop.
+
+ * sysdeps/m68k/sotruss-lib.c: New file.
+
+2012-11-21 Andreas Schwab <schwab@linux-m68k.org>
+
+ * sysdeps/unix/sysv/linux/m68k/nptl/lowlevellock.h
+ (lll_futex_timed_wait_bitset): Remove use of
+ INTERNAL_SYSCALL_ERROR_P.
+
+2012-11-20 Andreas Schwab <schwab@linux-m68k.org>
+
+ * sysdeps/m68k/m680x0/fpu/s_atan.c (weak_aliasx): Remove
+ macro and use weak_alias directly.
+ * sysdeps/m68k/m680x0/fpu/s_ccosh.c (weak_aliasx): Likewise.
+ * sysdeps/m68k/m680x0/fpu/s_cexp.c (weak_aliasx): Likewise.
+ * sysdeps/m68k/m680x0/fpu/s_csin.c (weak_aliasx): Likewise.
+ * sysdeps/m68k/m680x0/fpu/s_csinh.c (weak_aliasx): Likewise.
+ * sysdeps/m68k/m680x0/fpu/s_expm1.c (weak_aliasx): Likewise.
+ * sysdeps/m68k/m680x0/fpu/s_frexp.c (weak_aliasx): Likewise.
+ * sysdeps/m68k/m680x0/fpu/s_lrint.c (weak_aliasx): Likewise.
+ * sysdeps/m68k/m680x0/fpu/s_modf.c (weak_aliasx): Likewise.
+ * sysdeps/m68k/m680x0/fpu/s_isinf.c (weak_aliasx): Likewise.
+ * sysdeps/m68k/m680x0/fpu/s_remquo.c (weak_aliasx): Likewise.
+ * sysdeps/m68k/m680x0/fpu/s_scalbn.c (strong_aliasx, weak_aliasx):
+ Likewise.
+ * sysdeps/m68k/m680x0/fpu/s_sin.c (weak_aliasx): Likewise.
+ * sysdeps/m68k/m680x0/fpu/s_sincos.c (weak_aliasx): Likewise.
+
+2012-11-18 Andreas Schwab <schwab@linux-m68k.org>
+
+ * sysdeps/unix/sysv/linux/m68k/nptl/sysdep-cancel.h (_DOCARGS_5)
+ (UNDOCARGS_5): Save %d5 on stack instead of in %a1.
+
+2012-11-15 Andreas Schwab <schwab@linux-m68k.org>
+
+ * sysdeps/m68k/dl-machine.h (ELF_MACHINE_RUNTIME_FIXUP_PARAMS):
+ Define.
+
+2012-11-06 Andreas Schwab <schwab@linux-m68k.org>
+
+ * sysdeps/m68k/m680x0/fpu/libm-test-ulps: Update.
+
+ * sysdeps/unix/sysv/linux/m68k/nptl/lowlevellock.h
+ (lll_futex_timed_wait_bitset): Define.
+
2012-11-03 Joseph Myers <joseph@codesourcery.com>
* sysdeps/m68k/fpu/fclrexcpt.c (feclearexcept): Add
diff --git a/libc/ports/ChangeLog.mips b/libc/ports/ChangeLog.mips
index f5e73f8b3..b996ea6a1 100644
--- a/libc/ports/ChangeLog.mips
+++ b/libc/ports/ChangeLog.mips
@@ -1,3 +1,98 @@
+2012-11-30 Joseph Myers <joseph@codesourcery.com>
+
+ * sysdeps/mips/mips32/libm-test-ulps: Update.
+ * sysdeps/mips/mips64/libm-test-ulps: Likewise.
+
+2012-11-29 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #14893]
+ * sysdeps/mips/mips64/n32/_itoa.h: New file.
+ * sysdeps/unix/sysv/linux/mips/register-dump.h: Include
+ <sgidefs.h>.
+ (CTX_TYPE): New macro.
+ (CTX_REG): Likewise.
+ (CTX_PC): Likewise.
+ (CTX_MDHI): Likewise.
+ (CTX_MDLO): Likewise.
+ (REG_HEX_SIZE): Likewise.
+ (hexvalue): Take _ITOA_WORD_TYPE argument.
+ (register_dump): Use these macros instead of hardcoding struct
+ sigcontext * type and accesses and 8-byte textual output for
+ registers.
+
+2012-11-22 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #14822]
+ * sysdeps/unix/sysv/linux/mips/mips64/n64/syscalls.list
+ (sendfile): New syscall entry.
+ * sysdeps/unix/sysv/linux/mips/mips64/n64/sendfile64.c: New file.
+ Copy of ../sysdeps/unix/sysv/linux/wordsize-64/sendfile64.c.
+
+2012-11-21 Joseph Myers <joseph@codesourcery.com>
+
+ * sysdeps/mips/jmpbuf-unwind.h (_jmpbuf_sp): Cast regs[0].__sp to
+ uintptr_t.
+
+ * sysdeps/mips/sotruss-lib.c: New file.
+
+2012-11-20 Joseph Myers <joseph@codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/mips/mips32/sysdep.h
+ (internal_syscall1): Use parentheses around macro arguments.
+ (internal_syscall2): Likewise.
+ (internal_syscall3): Likewise.
+ (internal_syscall4): Likewise.
+ (internal_syscall5): Likewise.
+ (internal_syscall6): Likewise.
+ (internal_syscall7): Likewise.
+ * sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h
+ (internal_syscall1): Likewise.
+ (internal_syscall2): Likewise.
+ (internal_syscall3): Likewise.
+ (internal_syscall4): Likewise.
+ (internal_syscall5): Likewise.
+ (internal_syscall6): Likewise.
+
+ * sysdeps/mips/jmpbuf-unwind.h (_JMPBUF_CFA_UNWINDS_ADJ): Cast
+ _Unwind_GetCFA return to _Unwind_Ptr before casting to a pointer
+ type.
+ * sysdeps/unix/sysv/linux/mips/____longjmp_chk.c (CHECK_SP): Cast
+ ss_sp to long before casting to sp_type.
+ * sysdeps/unix/sysv/linux/mips/sigcontextinfo.h [_MIPS_SIM ==
+ _ABIO32] (GET_PC): Cast to unsigned long before casting to a
+ pointer type.
+ [_MIPS_SIM == _ABIO32] (GET_FRAME): Likewise.
+ [_MIPS_SIM == _ABIO32] (GET_STACK): Likewise.
+ [_MIPS_SIM != _ABIO32] (GET_PC): Likewise.
+ [_MIPS_SIM != _ABIO32] (GET_FRAME): Likewise.
+ [_MIPS_SIM != _ABIO32] (GET_STACK): Likewise.
+
+ * sysdeps/mips/bits/atomic.h [!__GNUC_PREREQ (4, 8)]
+ (__arch_compare_and_exchange_xxx_8_int): Separate assignments to
+ __prev and __cmp. Cast __cmp to void.
+ [!__GNUC_PREREQ (4, 8)] (__arch_compare_and_exchange_xxx_16_int):
+ Likewise.
+ [!__GNUC_PREREQ (4, 8) && _MIPS_SIM == _ABIO32]
+ (__arch_compare_and_exchange_xxx_64_int): Likewise.
+
+2012-11-19 Joseph Myers <joseph@codesourcery.com>
+
+ * sysdeps/mips/dl-machine.h (RESOLVE_GOTSYM): Declare VERSION
+ variable with __attribute__ ((unused)).
+
+ * sysdeps/unix/sysv/linux/mips/mips32/sysdep.h
+ (INTERNAL_SYSCALL_DECL): Use __attribute__ ((unused)).
+ (INTERNAL_SYSCALL_ERROR_P): Cast val to void.
+ (INTERNAL_SYSCALL_ERRNO): Cast err to void.
+ * sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h
+ (INTERNAL_SYSCALL_DECL): Use __attribute__ ((unused)).
+ (INTERNAL_SYSCALL_ERROR_P): Cast val to void.
+ (INTERNAL_SYSCALL_ERRNO): Cast err to void.
+ * sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h
+ (INTERNAL_SYSCALL_DECL): Use __attribute__ ((unused)).
+ (INTERNAL_SYSCALL_ERROR_P): Cast val to void.
+ (INTERNAL_SYSCALL_ERRNO): Cast err to void.
+
2012-11-17 Joseph Myers <joseph@codesourcery.com>
* sysdeps/mips/bits/atomic.h
diff --git a/libc/ports/ChangeLog.powerpc b/libc/ports/ChangeLog.powerpc
index a6fd7821f..cd7afb204 100644
--- a/libc/ports/ChangeLog.powerpc
+++ b/libc/ports/ChangeLog.powerpc
@@ -1,3 +1,9 @@
+2012-11-30 Joseph Myers <joseph@codesourcery.com>
+
+ * sysdeps/powerpc/nofpu/libm-test-ulps: Remove fma ulps.
+
+ * sysdeps/powerpc/nofpu/libm-test-ulps: Update.
+
2012-11-03 Joseph Myers <joseph@codesourcery.com>
* sysdeps/powerpc/nofpu/fclrexcpt.c (feclearexcept): Add
diff --git a/libc/ports/ChangeLog.tile b/libc/ports/ChangeLog.tile
index 7deb8a02f..67dc50c28 100644
--- a/libc/ports/ChangeLog.tile
+++ b/libc/ports/ChangeLog.tile
@@ -1,3 +1,18 @@
+2012-11-29 Chris Metcalf <cmetcalf@tilera.com>
+
+ * sysdeps/tile/s_fmaf.c: Remove redundant #defines now provided
+ in sysdeps/tile/math_private.h.
+
+2012-11-20 Chris Metcalf <cmetcalf@tilera.com>
+
+ * sysdeps/tile/libm-test-ulps: Account for new tests.
+
+ * sysdeps/tile/bits/byteswap.h: Include <bits/types.h>.
+ (__bswap_64): Use __uint64_t instead of unsigned long long int.
+
+ * sysdeps/tile/s_fma.c: Remove redundant #defines now provided
+ in sysdeps/tile/math_private.h.
+
2012-11-06 Chris Metcalf <cmetcalf@tilera.com>
* sysdeps/tile/tilegx/memmove.c: New file.
diff --git a/libc/ports/sysdeps/aarch64/dl-tlsdesc.S b/libc/ports/sysdeps/aarch64/dl-tlsdesc.S
index 0e590518f..b78a096e5 100644
--- a/libc/ports/sysdeps/aarch64/dl-tlsdesc.S
+++ b/libc/ports/sysdeps/aarch64/dl-tlsdesc.S
@@ -1,6 +1,6 @@
/* Thread-local storage handling in the ELF dynamic linker.
AArch64 version.
- Copyright (C) 2011, 2012 Free Software Foundation, Inc.
+ Copyright (C) 2011-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/libc/ports/sysdeps/aarch64/dl-tlsdesc.h b/libc/ports/sysdeps/aarch64/dl-tlsdesc.h
index 514e4ecfb..3e2eaa0a8 100644
--- a/libc/ports/sysdeps/aarch64/dl-tlsdesc.h
+++ b/libc/ports/sysdeps/aarch64/dl-tlsdesc.h
@@ -1,6 +1,6 @@
/* Thread-local storage descriptor handling in the ELF dynamic linker.
AArch64 version.
- Copyright (C) 2011, 2012 Free Software Foundation, Inc.
+ Copyright (C) 2011-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/libc/ports/sysdeps/aarch64/fpu/s_ceil.c b/libc/ports/sysdeps/aarch64/fpu/s_ceil.c
new file mode 100644
index 000000000..5010c4f79
--- /dev/null
+++ b/libc/ports/sysdeps/aarch64/fpu/s_ceil.c
@@ -0,0 +1,21 @@
+/* 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
+ modify it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define FUNC ceil
+#define INSN "frintp"
+#include <s_frint.c>
diff --git a/libc/ports/sysdeps/aarch64/fpu/s_ceilf.c b/libc/ports/sysdeps/aarch64/fpu/s_ceilf.c
new file mode 100644
index 000000000..e7f47361f
--- /dev/null
+++ b/libc/ports/sysdeps/aarch64/fpu/s_ceilf.c
@@ -0,0 +1,21 @@
+/* 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
+ modify it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define FUNC ceilf
+#define INSN "frintp"
+#include <s_frintf.c>
diff --git a/libc/ports/sysdeps/aarch64/fpu/s_floor.c b/libc/ports/sysdeps/aarch64/fpu/s_floor.c
new file mode 100644
index 000000000..26b79b447
--- /dev/null
+++ b/libc/ports/sysdeps/aarch64/fpu/s_floor.c
@@ -0,0 +1,21 @@
+/* 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
+ modify it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define FUNC floor
+#define INSN "frintm"
+#include <s_frint.c>
diff --git a/libc/ports/sysdeps/aarch64/fpu/s_floorf.c b/libc/ports/sysdeps/aarch64/fpu/s_floorf.c
new file mode 100644
index 000000000..1b7e01908
--- /dev/null
+++ b/libc/ports/sysdeps/aarch64/fpu/s_floorf.c
@@ -0,0 +1,21 @@
+/* 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
+ modify it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define FUNC floorf
+#define INSN "frintm"
+#include <s_frintf.c>
diff --git a/libc/ports/sysdeps/aarch64/fpu/s_fma.c b/libc/ports/sysdeps/aarch64/fpu/s_fma.c
index 8f6260587..c3b2344f7 100644
--- a/libc/ports/sysdeps/aarch64/fpu/s_fma.c
+++ b/libc/ports/sysdeps/aarch64/fpu/s_fma.c
@@ -1,2 +1,45 @@
-/* Always use dbl-64 version because long double is emulated in software. */
-#include <sysdeps/ieee754/dbl-64/s_fma.c>
+/* Copyright (C) 1996-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 <math.h>
+
+#ifndef FUNC
+# define FUNC fma
+#endif
+
+#ifndef TYPE
+# define TYPE double
+# define REGS "d"
+#else
+# ifndef REGS
+# error REGS not defined
+# endif
+#endif
+
+#define __CONCATX(a,b) __CONCAT(a,b)
+
+TYPE
+__CONCATX(__,FUNC) (TYPE x, TYPE y, TYPE z)
+{
+ TYPE result;
+ asm ( "fmadd" "\t%" REGS "0, %" REGS "1, %" REGS "2, %" REGS "3"
+ : "=w" (result) : "w" (x), "w" (y), "w" (z) );
+ return result;
+}
+
+weak_alias (__CONCATX(__,FUNC), FUNC)
diff --git a/libc/ports/sysdeps/aarch64/fpu/s_fmaf.c b/libc/ports/sysdeps/aarch64/fpu/s_fmaf.c
new file mode 100644
index 000000000..016d7bd64
--- /dev/null
+++ b/libc/ports/sysdeps/aarch64/fpu/s_fmaf.c
@@ -0,0 +1,22 @@
+/* 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
+ modify it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define FUNC fmaf
+#define TYPE float
+#define REGS "s"
+#include <s_fma.c>
diff --git a/libc/ports/sysdeps/aarch64/fpu/s_fmax.c b/libc/ports/sysdeps/aarch64/fpu/s_fmax.c
new file mode 100644
index 000000000..40804cc46
--- /dev/null
+++ b/libc/ports/sysdeps/aarch64/fpu/s_fmax.c
@@ -0,0 +1,21 @@
+/* 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
+ modify it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define FUNC fmax
+#define INSN "fmaxnm"
+#include <s_fmin.c>
diff --git a/libc/ports/sysdeps/aarch64/fpu/s_fmaxf.c b/libc/ports/sysdeps/aarch64/fpu/s_fmaxf.c
new file mode 100644
index 000000000..ed282bbda
--- /dev/null
+++ b/libc/ports/sysdeps/aarch64/fpu/s_fmaxf.c
@@ -0,0 +1,23 @@
+/* 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
+ modify it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define FUNC fmaxf
+#define INSN "fmaxnm"
+#define TYPE float
+#define REGS "s"
+#include <s_fmin.c>
diff --git a/libc/ports/sysdeps/aarch64/fpu/s_fmin.c b/libc/ports/sysdeps/aarch64/fpu/s_fmin.c
new file mode 100644
index 000000000..49ff9b365
--- /dev/null
+++ b/libc/ports/sysdeps/aarch64/fpu/s_fmin.c
@@ -0,0 +1,49 @@
+/* Copyright (C) 1996-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 <math.h>
+
+#ifndef FUNC
+# define FUNC fmin
+#endif
+
+#ifndef INSN
+# define INSN "fminnm"
+#endif
+
+#ifndef TYPE
+# define TYPE double
+# define REGS "d"
+#else
+# ifndef REGS
+# error REGS not defined
+# endif
+#endif
+
+#define __CONCATX(a,b) __CONCAT(a,b)
+
+TYPE
+__CONCATX(__,FUNC) (TYPE x, TYPE y)
+{
+ TYPE result;
+ asm ( INSN "\t%" REGS "0, %" REGS "1, %" REGS "2"
+ : "=w" (result) : "w" (x), "w" (y) );
+ return result;
+}
+
+weak_alias (__CONCATX(__,FUNC), FUNC)
diff --git a/libc/ports/sysdeps/aarch64/fpu/s_fminf.c b/libc/ports/sysdeps/aarch64/fpu/s_fminf.c
new file mode 100644
index 000000000..18b6ac026
--- /dev/null
+++ b/libc/ports/sysdeps/aarch64/fpu/s_fminf.c
@@ -0,0 +1,22 @@
+/* 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
+ modify it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define FUNC fminf
+#define TYPE float
+#define REGS "s"
+#include <s_fmin.c>
diff --git a/libc/ports/sysdeps/aarch64/fpu/s_frint.c b/libc/ports/sysdeps/aarch64/fpu/s_frint.c
new file mode 100644
index 000000000..69d9e2233
--- /dev/null
+++ b/libc/ports/sysdeps/aarch64/fpu/s_frint.c
@@ -0,0 +1,49 @@
+/* Copyright (C) 1996-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 <math.h>
+
+#ifndef FUNC
+# error FUNC not defined
+#endif
+
+#ifndef TYPE
+# define TYPE double
+# define REGS "d"
+#else
+# ifndef REGS
+# error REGS not defined
+# endif
+#endif
+
+#ifndef INSN
+# error INSN not defined
+#endif
+
+#define __CONCATX(a,b) __CONCAT(a,b)
+
+TYPE
+__CONCATX(__,FUNC) (TYPE x)
+{
+ TYPE result;
+ asm ( INSN "\t%" REGS "0, %" REGS "1" :
+ "=w" (result) : "w" (x) );
+ return result;
+}
+
+weak_alias (__CONCATX(__,FUNC), FUNC)
diff --git a/libc/ports/sysdeps/aarch64/fpu/s_frintf.c b/libc/ports/sysdeps/aarch64/fpu/s_frintf.c
new file mode 100644
index 000000000..8d24dda83
--- /dev/null
+++ b/libc/ports/sysdeps/aarch64/fpu/s_frintf.c
@@ -0,0 +1,24 @@
+/* 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
+ modify it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef FUNC
+# error FUNC not defined
+#endif
+#define TYPE float
+#define REGS "s"
+#include <s_frint.c>
diff --git a/libc/ports/sysdeps/aarch64/fpu/s_llrint.c b/libc/ports/sysdeps/aarch64/fpu/s_llrint.c
new file mode 100644
index 000000000..e46630381
--- /dev/null
+++ b/libc/ports/sysdeps/aarch64/fpu/s_llrint.c
@@ -0,0 +1,21 @@
+/* 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
+ modify it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define FUNC llrint
+#define OTYPE long long int
+#include <s_lrint.c>
diff --git a/libc/ports/sysdeps/aarch64/fpu/s_llrintf.c b/libc/ports/sysdeps/aarch64/fpu/s_llrintf.c
new file mode 100644
index 000000000..352dc519d
--- /dev/null
+++ b/libc/ports/sysdeps/aarch64/fpu/s_llrintf.c
@@ -0,0 +1,23 @@
+/* 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
+ modify it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define FUNC llrintf
+#define ITYPE float
+#define IREGS "s"
+#define OTYPE long long int
+#include <s_lrint.c>
diff --git a/libc/ports/sysdeps/aarch64/fpu/s_llround.c b/libc/ports/sysdeps/aarch64/fpu/s_llround.c
new file mode 100644
index 000000000..6aa365b68
--- /dev/null
+++ b/libc/ports/sysdeps/aarch64/fpu/s_llround.c
@@ -0,0 +1,21 @@
+/* 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
+ modify it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define FUNC llround
+#define OTYPE long long int
+#include <s_lround.c>
diff --git a/libc/ports/sysdeps/aarch64/fpu/s_llroundf.c b/libc/ports/sysdeps/aarch64/fpu/s_llroundf.c
new file mode 100644
index 000000000..98cf77e00
--- /dev/null
+++ b/libc/ports/sysdeps/aarch64/fpu/s_llroundf.c
@@ -0,0 +1,23 @@
+/* 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
+ modify it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define FUNC llroundf
+#define ITYPE float
+#define IREGS "s"
+#define OTYPE long long int
+#include <s_lround.c>
diff --git a/libc/ports/sysdeps/aarch64/fpu/s_lrint.c b/libc/ports/sysdeps/aarch64/fpu/s_lrint.c
new file mode 100644
index 000000000..ca26e09f9
--- /dev/null
+++ b/libc/ports/sysdeps/aarch64/fpu/s_lrint.c
@@ -0,0 +1,53 @@
+/* Copyright (C) 1996-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 <math.h>
+
+#ifndef FUNC
+# define FUNC lrint
+#endif
+
+#ifndef ITYPE
+# define ITYPE double
+# define IREGS "d"
+#else
+# ifndef IREGS
+# error IREGS not defined
+# endif
+#endif
+
+#ifndef OTYPE
+# define OTYPE long int
+#endif
+
+#define OREGS "x"
+
+#define __CONCATX(a,b) __CONCAT(a,b)
+
+OTYPE
+__CONCATX(__,FUNC) (ITYPE x)
+{
+ OTYPE result;
+ ITYPE temp;
+ asm ( "frintx" "\t%" IREGS "1, %" IREGS "2\n\t"
+ "fcvtzs" "\t%" OREGS "0, %" IREGS "1"
+ : "=r" (result), "=w" (temp) : "w" (x) );
+ return result;
+}
+
+weak_alias (__CONCATX(__,FUNC), FUNC)
diff --git a/libc/ports/sysdeps/aarch64/fpu/s_lrintf.c b/libc/ports/sysdeps/aarch64/fpu/s_lrintf.c
new file mode 100644
index 000000000..ff44650d7
--- /dev/null
+++ b/libc/ports/sysdeps/aarch64/fpu/s_lrintf.c
@@ -0,0 +1,22 @@
+/* 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
+ modify it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define FUNC lrintf
+#define ITYPE float
+#define IREGS "s"
+#include <s_lrint.c>
diff --git a/libc/ports/sysdeps/aarch64/fpu/s_lround.c b/libc/ports/sysdeps/aarch64/fpu/s_lround.c
new file mode 100644
index 000000000..83748ae39
--- /dev/null
+++ b/libc/ports/sysdeps/aarch64/fpu/s_lround.c
@@ -0,0 +1,51 @@
+/* Copyright (C) 1996-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 <math.h>
+
+#ifndef FUNC
+# define FUNC lround
+#endif
+
+#ifndef ITYPE
+# define ITYPE double
+# define IREGS "d"
+#else
+# ifndef IREGS
+# error IREGS not defined
+# endif
+#endif
+
+#ifndef OTYPE
+# define OTYPE long int
+#endif
+
+#define OREGS "x"
+
+#define __CONCATX(a,b) __CONCAT(a,b)
+
+OTYPE
+__CONCATX(__,FUNC) (ITYPE x)
+{
+ OTYPE result;
+ asm ( "fcvtas" "\t%" OREGS "0, %" IREGS "1"
+ : "=r" (result) : "w" (x) );
+ return result;
+}
+
+weak_alias (__CONCATX(__,FUNC), FUNC)
diff --git a/libc/ports/sysdeps/aarch64/fpu/s_lroundf.c b/libc/ports/sysdeps/aarch64/fpu/s_lroundf.c
new file mode 100644
index 000000000..eb553198c
--- /dev/null
+++ b/libc/ports/sysdeps/aarch64/fpu/s_lroundf.c
@@ -0,0 +1,22 @@
+/* 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
+ modify it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define FUNC lroundf
+#define ITYPE float
+#define IREGS "s"
+#include <s_lround.c>
diff --git a/libc/ports/sysdeps/aarch64/fpu/s_nearbyint.c b/libc/ports/sysdeps/aarch64/fpu/s_nearbyint.c
new file mode 100644
index 000000000..69eeccf30
--- /dev/null
+++ b/libc/ports/sysdeps/aarch64/fpu/s_nearbyint.c
@@ -0,0 +1,21 @@
+/* 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
+ modify it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define FUNC nearbyint
+#define INSN "frinti"
+#include <s_frint.c>
diff --git a/libc/ports/sysdeps/aarch64/fpu/s_nearbyintf.c b/libc/ports/sysdeps/aarch64/fpu/s_nearbyintf.c
new file mode 100644
index 000000000..19b26601a
--- /dev/null
+++ b/libc/ports/sysdeps/aarch64/fpu/s_nearbyintf.c
@@ -0,0 +1,21 @@
+/* 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
+ modify it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define FUNC nearbyintf
+#define INSN "frinti"
+#include <s_frintf.c>
diff --git a/libc/ports/sysdeps/aarch64/fpu/s_rint.c b/libc/ports/sysdeps/aarch64/fpu/s_rint.c
new file mode 100644
index 000000000..fad38d4fb
--- /dev/null
+++ b/libc/ports/sysdeps/aarch64/fpu/s_rint.c
@@ -0,0 +1,21 @@
+/* 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
+ modify it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define FUNC rint
+#define INSN "frintx"
+#include <s_frint.c>
diff --git a/libc/ports/sysdeps/aarch64/fpu/s_rintf.c b/libc/ports/sysdeps/aarch64/fpu/s_rintf.c
new file mode 100644
index 000000000..54353b802
--- /dev/null
+++ b/libc/ports/sysdeps/aarch64/fpu/s_rintf.c
@@ -0,0 +1,21 @@
+/* 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
+ modify it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define FUNC rintf
+#define INSN "frintx"
+#include <s_frintf.c>
diff --git a/libc/ports/sysdeps/aarch64/fpu/s_round.c b/libc/ports/sysdeps/aarch64/fpu/s_round.c
new file mode 100644
index 000000000..a566798ec
--- /dev/null
+++ b/libc/ports/sysdeps/aarch64/fpu/s_round.c
@@ -0,0 +1,21 @@
+/* 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
+ modify it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define FUNC round
+#define INSN "frinta"
+#include <s_frint.c>
diff --git a/libc/ports/sysdeps/aarch64/fpu/s_roundf.c b/libc/ports/sysdeps/aarch64/fpu/s_roundf.c
new file mode 100644
index 000000000..4684206e1
--- /dev/null
+++ b/libc/ports/sysdeps/aarch64/fpu/s_roundf.c
@@ -0,0 +1,21 @@
+/* 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
+ modify it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define FUNC roundf
+#define INSN "frinta"
+#include <s_frintf.c>
diff --git a/libc/ports/sysdeps/aarch64/fpu/s_trunc.c b/libc/ports/sysdeps/aarch64/fpu/s_trunc.c
new file mode 100644
index 000000000..767cb9fb2
--- /dev/null
+++ b/libc/ports/sysdeps/aarch64/fpu/s_trunc.c
@@ -0,0 +1,21 @@
+/* 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
+ modify it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define FUNC trunc
+#define INSN "frintz"
+#include <s_frint.c>
diff --git a/libc/ports/sysdeps/aarch64/fpu/s_truncf.c b/libc/ports/sysdeps/aarch64/fpu/s_truncf.c
new file mode 100644
index 000000000..1c952f7f8
--- /dev/null
+++ b/libc/ports/sysdeps/aarch64/fpu/s_truncf.c
@@ -0,0 +1,21 @@
+/* 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
+ modify it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define FUNC truncf
+#define INSN "frintz"
+#include <s_frintf.c>
diff --git a/libc/ports/sysdeps/aarch64/libm-test-ulps b/libc/ports/sysdeps/aarch64/libm-test-ulps
index df308e87d..68e705ae1 100644
--- a/libc/ports/sysdeps/aarch64/libm-test-ulps
+++ b/libc/ports/sysdeps/aarch64/libm-test-ulps
@@ -102,6 +102,9 @@ float: 1
ifloat: 1
ildouble: 1
ldouble: 1
+Test "atan2 (-max_value, -min_value) == -pi/2":
+float: 1
+ifloat: 1
Test "atan2 (0.75, -1.0) == 2.49809154479650885165983415456218025":
float: 1
ifloat: 1
@@ -2796,6 +2799,40 @@ double: 1
idouble: 1
ildouble: 1
ldouble: 1
+Test "y0 (0x1p-10) == -4.4865150767109739412411806297168793661098":
+ildouble: 1
+ldouble: 1
+Test "y0 (0x1p-110) == -4.861363632869203777249475899390797503250e+1":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "y0 (0x1p-20) == -8.8992283012125827603076426611387876938160":
+double: 1
+idouble: 1
+Test "y0 (0x1p-30) == -1.3311940304267782826037118027401817264906e+1":
+float: 1
+ifloat: 1
+ildouble: 2
+ldouble: 2
+Test "y0 (0x1p-40) == -1.7724652307320814696990854700366226762563e+1":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "y0 (0x1p-60) == -2.6550076313426878432849115782108205929120e+1":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "y0 (0x1p-70) == -3.0962788316479910300778244424468159753887e+1":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "y0 (0x1p-80) == -3.5375500319532942168707373066828113573541e+1":
+double: 1
+idouble: 1
Test "y0 (1.0) == 0.0882569642156769579829267660235151628":
double: 2
float: 1
@@ -2837,6 +2874,14 @@ ldouble: 1
Test "y1 (0x1.27e204p+99) == -8.881610148467797208469612080785210013461e-16":
double: 1
idouble: 1
+Test "y1 (0x1p-10) == -6.5190099301063115047395187618929589514382e+02":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "y1 (0x1p-30) == -6.8356527557643159612937462812258975438856e+08":
+ildouble: 1
+ldouble: 1
Test "y1 (1.5) == -0.412308626973911295952829820633445323":
float: 1
ifloat: 1
diff --git a/libc/ports/sysdeps/aarch64/tlsdesc.c b/libc/ports/sysdeps/aarch64/tlsdesc.c
index 4190c48df..606ce797c 100644
--- a/libc/ports/sysdeps/aarch64/tlsdesc.c
+++ b/libc/ports/sysdeps/aarch64/tlsdesc.c
@@ -1,6 +1,6 @@
/* Manage TLS descriptors. AArch64 version.
- Copyright (C) 2011, 2012 Free Software Foundation, Inc.
+ Copyright (C) 2011-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/libc/ports/sysdeps/alpha/fpu/libm-test-ulps b/libc/ports/sysdeps/alpha/fpu/libm-test-ulps
index a5d29412c..d546515ea 100644
--- a/libc/ports/sysdeps/alpha/fpu/libm-test-ulps
+++ b/libc/ports/sysdeps/alpha/fpu/libm-test-ulps
@@ -102,6 +102,9 @@ float: 1
ifloat: 1
ildouble: 1
ldouble: 1
+Test "atan2 (-max_value, -min_value) == -pi/2":
+float: 1
+ifloat: 1
Test "atan2 (0.75, -1.0) == 2.49809154479650885165983415456218025":
float: 1
ifloat: 1
@@ -876,6 +879,9 @@ float: 1
ifloat: 1
ildouble: 1
ldouble: 1
+Test "Real part of: clog (0x0.ffffffp0 + 0x0.ffffffp-100 i) == -5.960464655174753498633255797994360530379e-8 + 7.888609052210118054117285652827862296732e-31 i":
+float: 1
+ifloat: 1
Test "Real part of: clog (0x1.000566p0 + 0x1.234p-10 i) == 8.298731898331237038231468223024422855654e-5 + 1.110938609507128729312743251313024793990e-3 i":
float: 1
ifloat: 1
@@ -903,6 +909,9 @@ ldouble: 1
Test "Real part of: clog (0x1.fp+16383 - 0x1p-16494 i) == 11356.49165759582936919077408168801636572 - 0 i":
ildouble: 1
ldouble: 1
+Test "Imaginary part of: clog (0x10673dd0f2481p-51 + 0x7ef1d17cefbd2p-51 i) == 3.2047474274603604594851472963586149973093e-29 + 1.4422922682185099608731642353544207976604 i":
+ildouble: 1
+ldouble: 1
Test "Real part of: clog (0x1p-1074 + 0x1p-1074 i) == -744.0934983311012896593986823853525458290 + pi/4 i":
double: 1
idouble: 1
@@ -927,6 +936,50 @@ ldouble: 1
Test "Real part of: clog (0x1p-16494 - 0x1.fp+16383 i) == 11356.49165759582936919077408168801636572 - pi/2 i":
ildouble: 1
ldouble: 1
+Test "Imaginary part of: clog (0x2818p-15 + 0x798fp-15 i) == 1.5366822245016167178749091974664853785194e-08 + 1.2522014929038946066987318471922169174157 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog (0x298c62cb546588a7p-63 + 0x7911b1dfcc4ecdaep-63 i) == -1.1931267660846218205882675852805793644095e-36 + 1.2402109774337032400594953899784058127412 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog (0x2ede88p-23 + 0x771c3fp-23 i) == -4.4764192352906350039050902870893173560494e-13 + 1.1959106857549200806818600493552847793381 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog (0x3f96469050f650869c2p-75 + 0x6f16b2c9c8b05988335p-75 i) == -1.0509738482436128031927971874674370984602e-45 + 1.0509191467640012308402149909370784281448 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog (0x55cb6d0c83af5p-55 + 0x7fe33c0c7c4e90p-55 i) == -5.2000108498455368032511404449795741611813e-32 + 1.5288921536982513453421343495466824420259 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog (0x5b06b680ea2ccp-52 + 0xef452b965da9fp-52 i) == 8.3076914081087805757422664530653247447136e-30 + 1.2072712126771536614482822173033535043206 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog (0x659feap-24 + 0xeaf6f9p-24 i) == 3.7303493627403868207597214252239749960738e-14 + 1.1625816408046866464773042283673653469061 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog (0x6771f22c64ed551b857c128b4cp-105 + 0x1f570e7a13cc3cf2f44fd793ea1p-105 i) == -1.4281333889622737316199756373421183559948e-62 + 1.3673546561165378090903506783353927980633 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog (0x6b10b4f3520217b6p-64 + 0xe8893cbb449253a1p-64 i) == 2.4244570985709679851855191080208817099132e-37 + 1.1393074519572050614551047548718495655972 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog (0x8ecbf810c4ae6p-52 + 0xd479468b09a37p-52 i) == -9.7375017988218644730510244778042114638107e-30 + 0.9790637929494922564724108399524154766631 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog (0x9b57bp-20 + 0xcb7b4p-20 i) == -3.9563019528687610863490232935890272740908e-11 + 0.9187593477446338910857133065497364950682 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog (0xdb85c467ee2aadd5f425fe0f4b8dp-114 + 0x3e83162a0f95f1dcbf97dddf410eap-114 i) == 4.6017338806965821566734340588575402712716e-67 + 1.3547418904611758959096647942223384691728 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog (0xfd95243681c055c2632286921092p-113 + 0x1bccabcd29ca2152860ec29e34ef7p-113 i) == 6.6255694866654064502633121109394710807528e-66 + 1.0526409614996288387567810726095850312049 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog (0xfe961079616p-45 + 0x1bc37e09e6d1p-45 i) == 5.3718272201930019901317065495843842735179e-26 + 1.0503831592447830576186444373011142397404 i":
+ildouble: 1
+ldouble: 1
Test "Real part of: clog (1.0 + 0x1.234566p-10 i) == 6.172834701221959432440126967147726538097e-7 + 1.111110564353742042376451655136933182201e-3 i":
float: 1
ifloat: 1
@@ -1046,6 +1099,16 @@ ifloat: 1
Test "Imaginary part of: clog10 (0.75 + 1.25 i) == 0.163679467193165171449476605077428975 + 0.447486970040493067069984724340855636 i":
ildouble: 1
ldouble: 1
+Test "Real part of: clog10 (0x0.fffffffffffff8p0 + 0x0.fffffffffffff8p-1000 i) == -4.821637332766435821255375046554377090472e-17 + 4.053112396770095089737411317782466262176e-302 i":
+double: 1
+idouble: 1
+Test "Real part of: clog10 (0x0.ffffffp0 + 0x0.ffffffp-100 i) == -2.588596909321764128428416045209904492216e-8 + 3.425979381266895667295625489912064603415e-31 i":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 1
+ldouble: 1
Test "Real part of: clog10 (0x1.00000000000000123456789abcp0 + 0x1.23456789p-1000 i) == 4.285899851347756186652871946325962330640e-19 + 4.611541215247321502041995872887317363241e-302 i":
ildouble: 1
ldouble: 1
@@ -1103,6 +1166,37 @@ ldouble: 1
Test "Real part of: clog10 (0x1.fp+16383 + 0x1p+16383 i) == 4932.112944269463028900262609694408579449 + 0.2069271710841128115912940666587802677383 i":
ildouble: 1
ldouble: 1
+Test "Real part of: clog10 (0x10673dd0f2481p-51 + 0x7ef1d17cefbd2p-51 i) == 1.3918041236396763648388478552321724382899e-29 + 0.6263795733790237053262025311642907438291 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog10 (0x1367a310575591p-54 + 0x3cfcc0a0541f60p-54 i) == 2.2081507730821788480616336165447731164865e-32 + 0.5484039935757001196548030312819898864760 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (0x1367a310575591p-54 + 0x3cfcc0a0541f60p-54 i) == 2.2081507730821788480616336165447731164865e-32 + 0.5484039935757001196548030312819898864760 i":
+double: 1
+idouble: 1
+Test "Real part of: clog10 (0x1415bcaf2105940d49a636e98ae59p-115 + 0x7e6a150adfcd1b0921d44b31f40f4p-115 i) == 1.1288799405048268615023706955013387413519e-67 + 0.6137587762850841972073301550420510507903 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (0x15cfbd1990d1ffp-53 + 0x176a3973e09a9ap-53 i) == 4.4163015461643576961232672330852798804976e-31 + 0.3564851427422832755956993418877523303529 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (0x164c74eea876p-45 + 0x16f393482f77p-45 i) == -1.3155760824064879362415202279780039150764e-26 + 0.3473590599762514228227328130640352044313 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (0x1a6p-10 + 0x3a5p-10 i) == -6.2126412844802358329771948751248003038444e-07 + 0.4977135139537443711784513409096950995985 i":
+double: 1
+idouble: 1
+Test "Real part of: clog10 (0x1df515eb171a808b9e400266p-95 + 0x7c71eb0cd4688dfe98581c77p-95 i) == -1.5221162575729652613635150540947625639689e-57 + 0.5795934880811949230121092882659698986043 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (0x1df515eb171a808b9e400266p-95 + 0x7c71eb0cd4688dfe98581c77p-95 i) == -1.5221162575729652613635150540947625639689e-57 + 0.5795934880811949230121092882659698986043 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
@@ -1162,6 +1256,88 @@ double: 1
float: 1
idouble: 1
ifloat: 1
+Test "Real part of: clog10 (0x2818p-15 + 0x798fp-15 i) == 6.6737261053986614395049481326819059203910e-09 + 0.5438241985991753781478398141908629586460 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (0x2818p-15 + 0x798fp-15 i) == 6.6737261053986614395049481326819059203910e-09 + 0.5438241985991753781478398141908629586460 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog10 (0x2dd46725bp-35 + 0x7783a1284p-35 i) == 1.9312741086596516918394613098872836703188e-20 + 0.5231613813514771042838490538484014771862 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog10 (0x2ede88p-23 + 0x771c3fp-23 i) == -1.9440841725722970687903291200493082253766e-13 + 0.5193774116724956222518530053006822210323 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: clog10 (0x2ede88p-23 + 0x771c3fp-23 i) == -1.9440841725722970687903291200493082253766e-13 + 0.5193774116724956222518530053006822210323 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (0x3f96469050f650869c2p-75 + 0x6f16b2c9c8b05988335p-75 i) == -4.5643214291682663316715446865040356750881e-46 + 0.4564083863660793840592614609053162690362 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog10 (0x4447d7175p-35 + 0x6c445e00ap-35 i) == -6.4375803621988389731799033530075237868110e-21 + 0.4378257977686804492768642780897650927167 i":
+double: 1
+idouble: 1
+Test "Real part of: clog10 (0x4d4ep-15 + 0x6605p-15 i) == -7.0781945783414996953799915941870192015212e-09 + 0.4005747524909781155537088181659175147564 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog10 (0x4d9c37e2b5cb4533p-63 + 0x65c98be2385a042ep-63 i) == 2.7822833698845776001753149807484078521508e-37 + 0.3992725998539071066769046272515417679815 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog10 (0x55cb6d0c83af5p-55 + 0x7fe33c0c7c4e90p-55 i) == -2.2583360179249556400630343805573865814771e-32 + 0.6639894257763289307423302343317622430835 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (0x5b06b680ea2ccp-52 + 0xef452b965da9fp-52 i) == 3.6079845358966994996207055940336690133424e-30 + 0.5243112258263349992771652393178033846555 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog10 (0x602fd5037c4792efp-64 + 0xed3e2086dcca80b8p-64 i) == -1.0146400362652473358437501879334790111898e-37 + 0.5149047982335273098246594109614460842099 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog10 (0x6241ef0da53f539f02fad67dabp-106 + 0x3fb46641182f7efd9caa769dac0p-106 i) == 1.8804859395820231849002915747252695375405e-63 + 0.6404513901551516189871978418046651877394 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog10 (0x659feap-24 + 0xeaf6f9p-24 i) == 1.6200701438094619117335617123525612051457e-14 + 0.5049027913635038013499728086604870749732 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (0x659feap-24 + 0xeaf6f9p-24 i) == 1.6200701438094619117335617123525612051457e-14 + 0.5049027913635038013499728086604870749732 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (0x6b10b4f3520217b6p-64 + 0xe8893cbb449253a1p-64 i) == 1.0529283395205396881397407610630442563938e-37 + 0.4947949395762683446121140513971996916447 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (0x9b57bp-20 + 0xcb7b4p-20 i) == -1.7182001068739620267773842120965071561416e-11 + 0.3990121149225253562859800593935899629087 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog10 (0xdb85c467ee2aadd5f425fe0f4b8dp-114 + 0x3e83162a0f95f1dcbf97dddf410eap-114 i) == 1.9985076315737626043096596036300177494613e-67 + 0.5883569274304683249184005177865521205198 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog10 (0xf2p-10 + 0x3e3p-10 i) == 2.6921240173351112953324592659528481616879e-06 + 0.5785726025799636431142862788413361783862 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (0xf2p-10 + 0x3e3p-10 i) == 2.6921240173351112953324592659528481616879e-06 + 0.5785726025799636431142862788413361783862 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (0xfd95243681c055c2632286921092p-113 + 0x1bccabcd29ca2152860ec29e34ef7p-113 i) == 2.8774482675253468630312378575186855052697e-66 + 0.4571561610046221605554903008571429975493 i":
+ildouble: 2
+ldouble: 2
+Test "Imaginary part of: clog10 (0xfe961079616p-45 + 0x1bc37e09e6d1p-45 i) == 2.3329549194675052736016290082882121135546e-26 + 0.4561756099441139182878993697611751382976 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
Test "Imaginary part of: clog10 (1.0 + 0x1.234566p-10 i) == 2.680828048441605163181684680300513080769e-7 + 4.825491868832381486767558728169977751564e-4 i":
double: 1
idouble: 1
@@ -1564,6 +1740,7 @@ ldouble: 1
# csqrt
Test "Real part of: csqrt (-0x1.0000000000000000000000000001p-16382 - 0x1.0000000000000000000000000001p-16382 i) == 8.344545284118961663847948339519226074126e-2467 - 2.014551439675644900022606748976158925145e-2466 i":
+ildouble: 1
ldouble: 1
Test "Real part of: csqrt (-0x1.0000000000000002p-16382 - 0x1.0000000000000002p-16382 i) == 8.344545284118961664300307045791497724440e-2467 - 2.014551439675644900131815801350165472778e-2466 i":
ildouble: 1
@@ -1592,6 +1769,9 @@ ildouble: 1
ldouble: 1
Test "Imaginary part of: csqrt (0x1.0000000000000000000000000001p-16382 + 0x1.0000000000000000000000000001p-16382 i) == 2.014551439675644900022606748976158925145e-2466 + 8.344545284118961663847948339519226074126e-2":
ldouble: 1
+Test "Imaginary part of: csqrt (0x1.0000000000000000000000000001p-16382 + 0x1.0000000000000000000000000001p-16382 i) == 2.014551439675644900022606748976158925145e-2466 + 8.344545284118961663847948339519226074126e-2467 i":
+ildouble: 1
+ldouble: 1
Test "Real part of: csqrt (0x1.0000000000000002p-16382 + 0x1.0000000000000002p-16382 i) == 2.014551439675644900131815801350165472778e-2466 + 8.344545284118961664300307045791497724440e-2467 i":
ildouble: 1
ldouble: 1
@@ -2347,15 +2527,38 @@ ildouble: 1
ldouble: 1
# pow
+Test "pow (0x0.fffffffffffff8p0, -0x1.23456789abcdfp62) == 9.8826311568054561811190162420900667121992e+252":
+ildouble: 1
+ldouble: 1
Test "pow (0x0.ffffffp0, -0x1p24) == 2.7182819094701610539628664526874952929416":
float: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
Test "pow (0x0.ffffffp0, 0x1p24) == 0.3678794302077803437135155590023422899744":
float: 1
ifloat: 1
Test "pow (0x1.000002p0, 0x1p24) == 7.3890552180866447284268641248075832310141":
float: 1
ifloat: 1
+Test "pow (10.0, -4930.0) == 1e-4930":
+ildouble: 1
+ldouble: 1
+Test "pow (10.0, 4929.0) == 1e4929":
+ildouble: 1
+ldouble: 1
+Test "pow (10.0, 4930.0) == 1e4930":
+ildouble: 1
+ldouble: 1
+Test "pow (10.0, 4931.0) == 1e4931":
+ildouble: 1
+ldouble: 1
+Test "pow (10.0, 4932.0) == 1e4932":
+ildouble: 1
+ldouble: 1
+Test "pow (1e4932, 0.75) == 1e3699":
+ildouble: 1
+ldouble: 1
# pow_downward
Test "pow_downward (1.5, 1.03125) == 1.519127098714743184071644334163037684948":
@@ -2665,6 +2868,43 @@ double: 1
idouble: 1
ildouble: 1
ldouble: 1
+Test "y0 (0x1p-10) == -4.4865150767109739412411806297168793661098":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "y0 (0x1p-110) == -4.861363632869203777249475899390797503250e+1":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "y0 (0x1p-20) == -8.8992283012125827603076426611387876938160":
+float: 1
+ifloat: 1
+Test "y0 (0x1p-30) == -1.3311940304267782826037118027401817264906e+1":
+float: 1
+ifloat: 1
+ildouble: 2
+ldouble: 2
+Test "y0 (0x1p-40) == -1.7724652307320814696990854700366226762563e+1":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "y0 (0x1p-50) == -2.2137364310373846564919987139743760738155e+1":
+float: 1
+ifloat: 1
+Test "y0 (0x1p-60) == -2.6550076313426878432849115782108205929120e+1":
+ildouble: 1
+ldouble: 1
+Test "y0 (0x1p-70) == -3.0962788316479910300778244424468159753887e+1":
+double: 1
+idouble: 1
+Test "y0 (0x1p-80) == -3.5375500319532942168707373066828113573541e+1":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
Test "y0 (1.0) == 0.0882569642156769579829267660235151628":
double: 2
float: 1
@@ -2701,6 +2941,14 @@ ldouble: 1
Test "y1 (0x1.27e204p+99) == -8.881610148467797208469612080785210013461e-16":
double: 1
idouble: 1
+Test "y1 (0x1p-10) == -6.5190099301063115047395187618929589514382e+02":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "y1 (0x1p-30) == -6.8356527557643159612937462812258975438856e+08":
+ildouble: 1
+ldouble: 1
Test "y1 (1.5) == -0.412308626973911295952829820633445323":
float: 1
ifloat: 1
@@ -3397,6 +3645,8 @@ ldouble: 1
Function: "pow":
float: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
Function: "pow_downward":
float: 1
diff --git a/libc/ports/sysdeps/alpha/sotruss-lib.c b/libc/ports/sysdeps/alpha/sotruss-lib.c
new file mode 100644
index 000000000..0405c0a4e
--- /dev/null
+++ b/libc/ports/sysdeps/alpha/sotruss-lib.c
@@ -0,0 +1,50 @@
+/* Override generic sotruss-lib.c to define actual functions for Alpha.
+ 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/>. */
+
+#define HAVE_ARCH_PLTENTER
+#define HAVE_ARCH_PLTEXIT
+
+#include <elf/sotruss-lib.c>
+
+ElfW(Addr)
+la_alpha_gnu_pltenter (ElfW(Sym) *sym __attribute__ ((unused)),
+ unsigned int ndx __attribute__ ((unused)),
+ uintptr_t *refcook, uintptr_t *defcook,
+ La_alpha_regs *regs, unsigned int *flags,
+ const char *symname, long int *framesizep)
+{
+ print_enter (refcook, defcook, symname,
+ regs->lr_r16, regs->lr_r17, regs->lr_r18, *flags);
+
+ /* No need to copy anything, we will not need the parameters in any case. */
+ *framesizep = 0;
+
+ return sym->st_value;
+}
+
+unsigned int
+la_alpha_gnu_pltexit (ElfW(Sym) *sym, unsigned int ndx, uintptr_t *refcook,
+ uintptr_t *defcook,
+ const struct La_alpha_regs *inregs,
+ struct La_alpha_retval *outregs, const char *symname)
+{
+ print_exit (refcook, defcook, symname, outregs->lrv_r0);
+
+ return 0;
+}
diff --git a/libc/ports/sysdeps/arm/configure b/libc/ports/sysdeps/arm/configure
index 385f29590..91239cdf3 100644
--- a/libc/ports/sysdeps/arm/configure
+++ b/libc/ports/sysdeps/arm/configure
@@ -197,4 +197,7 @@ $as_echo "$libc_cv_arm_pcs_vfp" >&6; }
if test $libc_cv_arm_pcs_vfp = yes; then
$as_echo "#define HAVE_ARM_PCS_VFP 1" >>confdefs.h
+ echo "default-abi := hard" > default-abi.make
+else
+ echo "default-abi := soft" > default-abi.make
fi
diff --git a/libc/ports/sysdeps/arm/configure.in b/libc/ports/sysdeps/arm/configure.in
index 7e9133259..6073d0ee8 100644
--- a/libc/ports/sysdeps/arm/configure.in
+++ b/libc/ports/sysdeps/arm/configure.in
@@ -40,4 +40,7 @@ AC_CACHE_CHECK([whether the compiler is using the ARM hard-float ABI],
], libc_cv_arm_pcs_vfp=yes, libc_cv_arm_pcs_vfp=no)])
if test $libc_cv_arm_pcs_vfp = yes; then
AC_DEFINE(HAVE_ARM_PCS_VFP)
+ echo "default-abi := hard" > default-abi.make
+else
+ echo "default-abi := soft" > default-abi.make
fi
diff --git a/libc/ports/sysdeps/arm/fesetenv.c b/libc/ports/sysdeps/arm/fesetenv.c
index 2fad61da1..e92f9f5ac 100644
--- a/libc/ports/sysdeps/arm/fesetenv.c
+++ b/libc/ports/sysdeps/arm/fesetenv.c
@@ -40,6 +40,16 @@ __fesetenv (const fenv_t *envp)
_FPU_SETCW (temp);
+ if (envp == FE_NOMASK_ENV)
+ {
+ /* VFPv3 and VFPv4 do not support trapping exceptions, so
+ test whether the relevant bits were set and fail if
+ not. */
+ _FPU_GETCW (temp);
+ if ((temp & _FPU_IEEE) != _FPU_IEEE)
+ return 1;
+ }
+
/* Success. */
return 0;
}
diff --git a/libc/ports/sysdeps/arm/libm-test-ulps b/libc/ports/sysdeps/arm/libm-test-ulps
index 51356dddb..e0c7e0d47 100644
--- a/libc/ports/sysdeps/arm/libm-test-ulps
+++ b/libc/ports/sysdeps/arm/libm-test-ulps
@@ -72,6 +72,9 @@ ifloat: 1
Test "atan2 (-0.75, -1.0) == -2.49809154479650885165983415456218025":
float: 1
ifloat: 1
+Test "atan2 (-max_value, -min_value) == -pi/2":
+float: 1
+ifloat: 1
Test "atan2 (0.75, -1.0) == 2.49809154479650885165983415456218025":
float: 1
ifloat: 1
@@ -519,7 +522,43 @@ float: 2
ifloat: 2
# clog
-Test "Real part of: clog (0.75 + 1.25 i) == 0.376885901188190075998919126749298416 + 1.03037682652431246378774332703115153 i":
+Test "Real part of: clog (-0x1.0000000123456p0 + 0x1.2345678p-1000 i) == 2.649094276923003995420209214900915462737e-10 + 3.141592653589793238462643383279502884197 i":
+double: 1
+idouble: 1
+Test "Real part of: clog (-0x1.0000000123456p0 + 0x1.2345678p-30 i) == 2.649094282537168795982991778475646793277e-10 + 3.141592652530155111500161671113150737892 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog (-0x1.234566p-40 - 1.0 i) == 5.354083939753840089583620652120903838944e-25 - 1.570796326795931422008642456283782656359 i":
+float: 1
+ifloat: 1
+Test "Real part of: clog (-0x1.fp+127 + 0x1p-149 i) == 88.69109041335841930424871526389807508374 + pi i":
+float: 1
+ifloat: 1
+Test "Real part of: clog (-0x1.fp+127 - 0x1p-149 i) == 88.69109041335841930424871526389807508374 - pi i":
+float: 1
+ifloat: 1
+Test "Real part of: clog (-0x1p-149 + 0x1.fp+127 i) == 88.69109041335841930424871526389807508374 + pi/2 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: clog (-0x1p-149 + 0x1.fp+127 i) == 88.69109041335841930424871526389807508374 + pi/2 i":
+float: 1
+ifloat: 1
+Test "Real part of: clog (-0x1p-149 - 0x1.fp+127 i) == 88.69109041335841930424871526389807508374 - pi/2 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: clog (-0x1p-149 - 0x1.fp+127 i) == 88.69109041335841930424871526389807508374 - pi/2 i":
+float: 1
+ifloat: 1
+Test "Real part of: clog (0x0.ffffffp0 + 0x0.ffffffp-100 i) == -5.960464655174753498633255797994360530379e-8 + 7.888609052210118054117285652827862296732e-31 i":
+float: 1
+ifloat: 1
+Test "Real part of: clog (0x1.000566p0 + 0x1.234p-10 i) == 8.298731898331237038231468223024422855654e-5 + 1.110938609507128729312743251313024793990e-3 i":
+float: 1
+ifloat: 1
+Test "Real part of: clog (0x1.fp+127 + 0x1p-149 i) == 88.69109041335841930424871526389807508374 + +0 i":
+float: 1
+ifloat: 1
+Test "Real part of: clog (0x1.fp+127 - 0x1p-149 i) == 88.69109041335841930424871526389807508374 - 0 i":
float: 1
ifloat: 1
Test "Real part of: clog (0x1p-1074 + 0x1p-1074 i) == -744.0934983311012896593986823853525458290 + pi/4 i":
@@ -528,6 +567,18 @@ idouble: 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 + 0x1.fp+127 i) == 88.69109041335841930424871526389807508374 + pi/2 i":
+float: 1
+ifloat: 1
+Test "Real part of: clog (0x1p-149 - 0x1.fp+127 i) == 88.69109041335841930424871526389807508374 - pi/2 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: clog (0x2818p-15 + 0x798fp-15 i) == 1.5366822245016167178749091974664853785194e-08 + 1.2522014929038946066987318471922169174157 i":
+float: 1
+ifloat: 1
+Test "Real part of: clog (1.0 + 0x1.234566p-10 i) == 6.172834701221959432440126967147726538097e-7 + 1.111110564353742042376451655136933182201e-3 i":
+float: 1
+ifloat: 1
# clog10
Test "Imaginary part of: clog10 (-0 + inf i) == inf + pi/2*log10(e) i":
@@ -536,6 +587,49 @@ ifloat: 1
Test "Imaginary part of: clog10 (-0 - inf i) == inf - pi/2*log10(e) i":
float: 1
ifloat: 1
+Test "Real part of: clog10 (-0x1.0000000123456p0 + 0x1.2345678p-1000 i) == 1.150487026509145544402795327729455391948e-10 + 1.364376353841841347485783625431355770210 i":
+double: 2
+idouble: 2
+Test "Imaginary part of: clog10 (-0x1.0000000123456p0 + 0x1.2345678p-1000 i) == 1.150487026509145544402795327729455391948e-10 + 1.364376353841841347485783625431355770210 i":
+double: 1
+idouble: 1
+Test "Real part of: clog10 (-0x1.0000000123456p0 + 0x1.2345678p-30 i) == 1.150487028947346337782682105935961875822e-10 + 1.364376353381646356131680448946397884147 i":
+double: 2
+idouble: 2
+Test "Imaginary part of: clog10 (-0x1.0000000123456p0 + 0x1.2345678p-30 i) == 1.150487028947346337782682105935961875822e-10 + 1.364376353381646356131680448946397884147 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (-0x1.fp+1023 + 0x1p-1074 i) == 308.2409272754311106024666378243768099991 + 1.364376353841841347485783625431355770210 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (-0x1.fp+1023 - 0x1p-1074 i) == 308.2409272754311106024666378243768099991 - 1.364376353841841347485783625431355770210 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (-0x1.fp+127 + 0x1p-149 i) == 38.51805116050395969095658815123105801479 + 1.364376353841841347485783625431355770210 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Imaginary part of: clog10 (-0x1.fp+127 - 0x1p-149 i) == 38.51805116050395969095658815123105801479 - 1.364376353841841347485783625431355770210 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Imaginary part of: clog10 (-0x1p-1074 + 0x1.fp+1023 i) == 308.2409272754311106024666378243768099991 + 0.6821881769209206737428918127156778851051 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (-0x1p-1074 - 0x1.fp+1023 i) == 308.2409272754311106024666378243768099991 - 0.6821881769209206737428918127156778851051 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (-0x1p-149 + 0x1.fp+127 i) == 38.51805116050395969095658815123105801479 + 0.6821881769209206737428918127156778851051 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (-0x1p-149 - 0x1.fp+127 i) == 38.51805116050395969095658815123105801479 - 0.6821881769209206737428918127156778851051 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (-1.0 + 0x1.234566p-20 i) == 2.556638434669064077889576526006849923281e-13 + 1.364375882602207106407956770293808181427 i":
+double: 1
+idouble: 1
Test "Imaginary part of: clog10 (-2 - 3 i) == 0.556971676153418384603252578971164214 - 0.937554462986374708541507952140189646 i":
double: 1
idouble: 1
@@ -563,24 +657,142 @@ ifloat: 1
Test "Imaginary part of: clog10 (0 - inf i) == inf - pi/2*log10(e) i":
float: 1
ifloat: 1
-Test "Real part of: clog10 (0.75 + 1.25 i) == 0.163679467193165171449476605077428975 + 0.447486970040493067069984724340855636 i":
+Test "Real part of: clog10 (0x0.fffffffffffff8p0 + 0x0.fffffffffffff8p-1000 i) == -4.821637332766435821255375046554377090472e-17 + 4.053112396770095089737411317782466262176e-302 i":
+double: 1
+idouble: 1
+Test "Real part of: clog10 (0x0.ffffffp0 + 0x0.ffffffp-100 i) == -2.588596909321764128428416045209904492216e-8 + 3.425979381266895667295625489912064603415e-31 i":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+Test "Real part of: clog10 (0x1.000566p0 + 0x1.234p-10 i) == 3.604093470239754109961125085078190708674e-5 + 4.824745078422174667425851670822596859720e-4 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: clog10 (0x1.000566p0 + 0x1.234p-10 i) == 3.604093470239754109961125085078190708674e-5 + 4.824745078422174667425851670822596859720e-4 i":
+double: 1
+idouble: 1
+Test "Real part of: clog10 (0x1.000566p0 + 0x1.234p-100 i) == 3.577293486783822178310971763308187385546e-5 + 3.897399639875661463735636919790792140598e-31 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: clog10 (0x1.234566p-30 + 1.0 i) == 2.438200411482400072282924063740535840474e-19 + 6.821881764607257184291586401763604544928e-1 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: clog10 (0x1.234566p-50 + 1.0 i) == 2.217530356103816369479108963807448194409e-31 + 6.821881769209202348667823902864283966959e-1 i":
float: 1
ifloat: 1
+Test "Imaginary part of: clog10 (0x1.234566p-60 + 1.0 i) == 2.114801746467415208319767917450504756866e-37 + 6.821881769209206733143018621078368211515e-1 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
Test "Imaginary part of: clog10 (0x1.fffffep+127 + 0x1.fffffep+127 i) == 38.68235441693561449174780668781319348761 + pi/4*log10(e) i":
float: 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 "Real part of: clog10 (0x10673dd0f2481p-51 + 0x7ef1d17cefbd2p-51 i) == 1.3918041236396763648388478552321724382899e-29 + 0.6263795733790237053262025311642907438291 i":
+double: 1
+idouble: 1
+Test "Real part of: clog10 (0x1367a310575591p-54 + 0x3cfcc0a0541f60p-54 i) == 2.2081507730821788480616336165447731164865e-32 + 0.5484039935757001196548030312819898864760 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (0x1367a310575591p-54 + 0x3cfcc0a0541f60p-54 i) == 2.2081507730821788480616336165447731164865e-32 + 0.5484039935757001196548030312819898864760 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (0x164c74eea876p-45 + 0x16f393482f77p-45 i) == -1.3155760824064879362415202279780039150764e-26 + 0.3473590599762514228227328130640352044313 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (0x1a6p-10 + 0x3a5p-10 i) == -6.2126412844802358329771948751248003038444e-07 + 0.4977135139537443711784513409096950995985 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (0x1p-1074 + 0x1.fp+1023 i) == 308.2409272754311106024666378243768099991 + 0.6821881769209206737428918127156778851051 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 - 0x1.fp+1023 i) == 308.2409272754311106024666378243768099991 - 0.6821881769209206737428918127156778851051 i":
+double: 1
+idouble: 1
Test "Imaginary part of: clog10 (0x1p-147 + 0x1p-147 i) == -44.10089436477324509881274807713822842154 + pi/4*log10(e) i":
float: 1
ifloat: 1
+Test "Imaginary part of: clog10 (0x1p-149 + 0x1.fp+127 i) == 38.51805116050395969095658815123105801479 + 0.6821881769209206737428918127156778851051 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":
float: 1
ifloat: 1
+Test "Imaginary part of: clog10 (0x1p-149 - 0x1.fp+127 i) == 38.51805116050395969095658815123105801479 - 0.6821881769209206737428918127156778851051 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Imaginary part of: clog10 (0x1p-509 + 1.0 i) == 7.730698388614835910296270976605350994446e-308 + 6.821881769209206737428918127156778851051e-1 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (0x1p-510 + 1.0 i) == 1.932674597153708977574067744151337748612e-308 + 6.821881769209206737428918127156778851051e-1 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (0x1p-511 + 1.0 i) == 4.831686492884272443935169360378344371529e-309 + 6.821881769209206737428918127156778851051e-1 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (0x1p-61 + 1.0 i) == 4.084085680564517578238994467153626207224e-38 + 6.821881769209206735545466044044889962925e-1 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Imaginary part of: clog10 (0x1p-62 + 1.0 i) == 1.021021420141129394559748616788406551878e-38 + 6.821881769209206736487192085600834406988e-1 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Imaginary part of: clog10 (0x1p-63 + 1.0 i) == 2.552553550352823486399371541971016379740e-39 + 6.821881769209206736958055106378806629019e-1 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Real part of: clog10 (0x2818p-15 + 0x798fp-15 i) == 6.6737261053986614395049481326819059203910e-09 + 0.5438241985991753781478398141908629586460 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Imaginary part of: clog10 (0x2818p-15 + 0x798fp-15 i) == 6.6737261053986614395049481326819059203910e-09 + 0.5438241985991753781478398141908629586460 i":
+float: 1
+ifloat: 1
+Test "Real part of: clog10 (0x2dd46725bp-35 + 0x7783a1284p-35 i) == 1.9312741086596516918394613098872836703188e-20 + 0.5231613813514771042838490538484014771862 i":
+double: 1
+idouble: 1
+Test "Real part of: clog10 (0x2ede88p-23 + 0x771c3fp-23 i) == -1.9440841725722970687903291200493082253766e-13 + 0.5193774116724956222518530053006822210323 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: clog10 (0x2ede88p-23 + 0x771c3fp-23 i) == -1.9440841725722970687903291200493082253766e-13 + 0.5193774116724956222518530053006822210323 i":
+double: 1
+idouble: 1
+Test "Real part of: clog10 (0x4447d7175p-35 + 0x6c445e00ap-35 i) == -6.4375803621988389731799033530075237868110e-21 + 0.4378257977686804492768642780897650927167 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (0x5b06b680ea2ccp-52 + 0xef452b965da9fp-52 i) == 3.6079845358966994996207055940336690133424e-30 + 0.5243112258263349992771652393178033846555 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (0x9b57bp-20 + 0xcb7b4p-20 i) == -1.7182001068739620267773842120965071561416e-11 + 0.3990121149225253562859800593935899629087 i":
+double: 1
+idouble: 1
+Test "Real part of: clog10 (0xf2p-10 + 0x3e3p-10 i) == 2.6921240173351112953324592659528481616879e-06 + 0.5785726025799636431142862788413361783862 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (0xf2p-10 + 0x3e3p-10 i) == 2.6921240173351112953324592659528481616879e-06 + 0.5785726025799636431142862788413361783862 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (0xfe961079616p-45 + 0x1bc37e09e6d1p-45 i) == 2.3329549194675052736016290082882121135546e-26 + 0.4561756099441139182878993697611751382976 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (1.0 + 0x1.234566p-10 i) == 2.680828048441605163181684680300513080769e-7 + 4.825491868832381486767558728169977751564e-4 i":
+double: 1
+idouble: 1
Test "Imaginary part of: clog10 (3 + inf i) == inf + pi/2*log10(e) i":
float: 1
ifloat: 1
@@ -595,6 +807,12 @@ float: 1
ifloat: 1
# cos
+Test "cos (0x1p+120) == -9.25879022854837867303861764107414946730833e-01":
+float: 1
+ifloat: 1
+Test "cos (0x1p+127) == 7.81914638714960072263910298466369236613162e-01":
+float: 1
+ifloat: 1
Test "cos (M_PI_6l * 2.0) == 0.5":
double: 1
idouble: 1
@@ -689,9 +907,6 @@ ifloat: 1
Test "Real part of: cpow (0.75 + 1.25 i, 0.0 + 1.0 i) == 0.331825439177608832276067945276730566 + 0.131338600281188544930936345230903032 i":
float: 1
ifloat: 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
Test "Real part of: cpow (0.75 + 1.25 i, 0.75 + 1.25 i) == 0.117506293914473555420279832210420483 + 0.346552747708338676483025352060418001 i":
double: 1
float: 4
@@ -784,12 +999,18 @@ float: 1
ifloat: 1
# csqrt
+Test "Real part of: csqrt (-0x1.000002p-126 - 0x1.000002p-126 i) == 4.934094449071842328766868579214125217132e-20 - 1.191195773697904627170323731331667740087e-19 i":
+double: 1
+idouble: 1
Test "Real part of: csqrt (-2 + 3 i) == 0.89597747612983812471573375529004348 + 1.6741492280355400404480393008490519 i":
float: 1
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.000002p-126 + 0x1.000002p-126 i) == 1.191195773697904627170323731331667740087e-19 + 4.934094449071842328766868579214125217132e-20 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
@@ -823,6 +1044,47 @@ Test "Real part of: ctan (0x3.243f6cp-1 + 0 i) == -2.287733242885645987394874673
float: 1
ifloat: 1
+# ctan_downward
+Test "Real part of: ctan_downward (0x1.921fb6p+0 + 0x1p-149 i) == -2.287733242885645987394874673945769518150e7 + 7.334008549954377778731880988481078535821e-31 i":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+Test "Imaginary part of: ctan_downward (0x1.921fb6p+0 + 0x1p-149 i) == -2.287733242885645987394874673945769518150e7 + 7.334008549954377778731880988481078535821e-31 i":
+float: 1
+ifloat: 1
+
+# ctan_tonearest
+Test "Real part of: ctan_tonearest (0x1.921fb6p+0 + 0x1p-149 i) == -2.287733242885645987394874673945769518150e7 + 7.334008549954377778731880988481078535821e-31 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: ctan_tonearest (0x1.921fb6p+0 + 0x1p-149 i) == -2.287733242885645987394874673945769518150e7 + 7.334008549954377778731880988481078535821e-31 i":
+float: 1
+ifloat: 1
+
+# ctan_towardzero
+Test "Real part of: ctan_towardzero (0x1.921fb6p+0 + 0x1p-149 i) == -2.287733242885645987394874673945769518150e7 + 7.334008549954377778731880988481078535821e-31 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: ctan_towardzero (0x1.921fb6p+0 + 0x1p-149 i) == -2.287733242885645987394874673945769518150e7 + 7.334008549954377778731880988481078535821e-31 i":
+float: 1
+ifloat: 1
+
+# ctan_upward
+Test "Real part of: ctan_upward (0x1.921fb54442d18p+0 + 0x1p-1074 i) == 1.633123935319536975596773704152891653086e16 + 1.317719414943508315995636961402669067843e-291 i":
+double: 1
+idouble: 1
+Test "Real part of: ctan_upward (0x1.921fb6p+0 + 0x1p-149 i) == -2.287733242885645987394874673945769518150e7 + 7.334008549954377778731880988481078535821e-31 i":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+Test "Imaginary part of: ctan_upward (0x1.921fb6p+0 + 0x1p-149 i) == -2.287733242885645987394874673945769518150e7 + 7.334008549954377778731880988481078535821e-31 i":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
# ctanh
Test "Real part of: ctanh (-2 - 3 i) == -0.965385879022133124278480269394560686 + 0.988437503832249372031403430350121098e-2 i":
double: 1
@@ -857,6 +1119,47 @@ Test "Real part of: ctanh (1 + 0x1p127 i) == 0.910133404767618376153287379442647
double: 1
idouble: 1
+# ctanh_downward
+Test "Real part of: ctanh_downward (0x1p-149 + 0x1.921fb6p+0 i) == 7.334008549954377778731880988481078535821e-31 - 2.287733242885645987394874673945769518150e7 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: ctanh_downward (0x1p-149 + 0x1.921fb6p+0 i) == 7.334008549954377778731880988481078535821e-31 - 2.287733242885645987394874673945769518150e7 i":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+
+# ctanh_tonearest
+Test "Real part of: ctanh_tonearest (0x1p-149 + 0x1.921fb6p+0 i) == 7.334008549954377778731880988481078535821e-31 - 2.287733242885645987394874673945769518150e7 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: ctanh_tonearest (0x1p-149 + 0x1.921fb6p+0 i) == 7.334008549954377778731880988481078535821e-31 - 2.287733242885645987394874673945769518150e7 i":
+float: 1
+ifloat: 1
+
+# ctanh_towardzero
+Test "Real part of: ctanh_towardzero (0x1p-149 + 0x1.921fb6p+0 i) == 7.334008549954377778731880988481078535821e-31 - 2.287733242885645987394874673945769518150e7 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: ctanh_towardzero (0x1p-149 + 0x1.921fb6p+0 i) == 7.334008549954377778731880988481078535821e-31 - 2.287733242885645987394874673945769518150e7 i":
+float: 1
+ifloat: 1
+
+# ctanh_upward
+Test "Imaginary part of: ctanh_upward (0x1p-1074 + 0x1.921fb54442d18p+0 i) == 1.317719414943508315995636961402669067843e-291 + 1.633123935319536975596773704152891653086e16 i":
+double: 1
+idouble: 1
+Test "Real part of: ctanh_upward (0x1p-149 + 0x1.921fb6p+0 i) == 7.334008549954377778731880988481078535821e-31 - 2.287733242885645987394874673945769518150e7 i":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+Test "Imaginary part of: ctanh_upward (0x1p-149 + 0x1.921fb6p+0 i) == 7.334008549954377778731880988481078535821e-31 - 2.287733242885645987394874673945769518150e7 i":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+
# erf
Test "erf (1.25) == 0.922900128256458230136523481197281140":
double: 1
@@ -1215,6 +1518,12 @@ float: 1
ifloat: 1
# sincos
+Test "sincos (0x1p+120, &sin_res, &cos_res) puts -9.25879022854837867303861764107414946730833e-01 in cos_res":
+float: 1
+ifloat: 1
+Test "sincos (0x1p+127, &sin_res, &cos_res) puts 7.81914638714960072263910298466369236613162e-01 in cos_res":
+float: 1
+ifloat: 1
Test "sincos (M_PI_6l*2.0, &sin_res, &cos_res) puts 0.5 in cos_res":
double: 1
idouble: 1
@@ -1322,6 +1631,34 @@ idouble: 1
Test "y0 (0x1.ff00000000002p+840) == 1.846591691699331493194965158699937660696e-127":
double: 1
idouble: 1
+Test "y0 (0x1p-10) == -4.4865150767109739412411806297168793661098":
+double: 1
+idouble: 1
+Test "y0 (0x1p-110) == -4.861363632869203777249475899390797503250e+1":
+double: 1
+idouble: 1
+Test "y0 (0x1p-20) == -8.8992283012125827603076426611387876938160":
+float: 1
+ifloat: 1
+Test "y0 (0x1p-30) == -1.3311940304267782826037118027401817264906e+1":
+float: 1
+ifloat: 1
+Test "y0 (0x1p-40) == -1.7724652307320814696990854700366226762563e+1":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "y0 (0x1p-50) == -2.2137364310373846564919987139743760738155e+1":
+float: 1
+ifloat: 1
+Test "y0 (0x1p-70) == -3.0962788316479910300778244424468159753887e+1":
+double: 1
+idouble: 1
+Test "y0 (0x1p-80) == -3.5375500319532942168707373066828113573541e+1":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
Test "y0 (1.0) == 0.0882569642156769579829267660235151628":
double: 2
float: 1
@@ -1348,6 +1685,9 @@ idouble: 1
Test "y1 (0x1.27e204p+99) == -8.881610148467797208469612080785210013461e-16":
double: 1
idouble: 1
+Test "y1 (0x1p-10) == -6.5190099301063115047395187618929589514382e+02":
+double: 1
+idouble: 1
Test "y1 (1.5) == -0.412308626973911295952829820633445323":
float: 1
ifloat: 1
@@ -1582,12 +1922,16 @@ float: 1
idouble: 1
ifloat: 1
-Function: Real part of "clog10":
-double: 1
+Function: Imaginary part of "clog":
float: 1
-idouble: 1
ifloat: 1
+Function: Real part of "clog10":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
Function: Imaginary part of "clog10":
double: 1
float: 1
@@ -1674,6 +2018,44 @@ Function: Imaginary part of "ctan":
double: 1
idouble: 1
+Function: Real part of "ctan_downward":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+
+Function: Imaginary part of "ctan_downward":
+float: 1
+ifloat: 1
+
+Function: Real part of "ctan_tonearest":
+float: 1
+ifloat: 1
+
+Function: Imaginary part of "ctan_tonearest":
+float: 1
+ifloat: 1
+
+Function: Real part of "ctan_towardzero":
+float: 1
+ifloat: 1
+
+Function: Imaginary part of "ctan_towardzero":
+float: 1
+ifloat: 1
+
+Function: Real part of "ctan_upward":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+
+Function: Imaginary part of "ctan_upward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
Function: Real part of "ctanh":
double: 1
float: 1
@@ -1686,6 +2068,44 @@ float: 2
idouble: 1
ifloat: 2
+Function: Real part of "ctanh_downward":
+float: 1
+ifloat: 1
+
+Function: Imaginary part of "ctanh_downward":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+
+Function: Real part of "ctanh_tonearest":
+float: 1
+ifloat: 1
+
+Function: Imaginary part of "ctanh_tonearest":
+float: 1
+ifloat: 1
+
+Function: Real part of "ctanh_towardzero":
+float: 1
+ifloat: 1
+
+Function: Imaginary part of "ctanh_towardzero":
+float: 1
+ifloat: 1
+
+Function: Real part of "ctanh_upward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: Imaginary part of "ctanh_upward":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+
Function: "erf":
double: 1
idouble: 1
diff --git a/libc/ports/sysdeps/hppa/__longjmp.S b/libc/ports/sysdeps/hppa/__longjmp.S
deleted file mode 100644
index 4ef219e41..000000000
--- a/libc/ports/sysdeps/hppa/__longjmp.S
+++ /dev/null
@@ -1,71 +0,0 @@
-/* longjmp for PA-RISC.
- Copyright (C) 1997, 1998 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy 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 _SETJMP_H
-#define _ASM
-#include <bits/setjmp.h>
-
-/* __longjmp(jmpbuf, val) */
-
- .text
- .align 4
- .globl __longjmp
- .export __longjmp, code
- .proc
- .callinfo
-__longjmp:
- /* set return value */
- copy %r25, %r28
-
- ldw 0(%r26), %r3
- ldw 8(%r26), %r4
- ldw 12(%r26), %r5
- ldw 16(%r26), %r6
- ldw 20(%r26), %r7
- ldw 24(%r26), %r8
- ldw 28(%r26), %r9
- ldw 32(%r26), %r10
- ldw 36(%r26), %r11
- ldw 40(%r26), %r12
- ldw 44(%r26), %r13
- ldw 48(%r26), %r14
- ldw 52(%r26), %r15
- ldw 56(%r26), %r16
- ldw 60(%r26), %r17
- ldw 64(%r26), %r18
- ldw 68(%r26), %r19
- ldw 72(%r26), %r27
- ldw 76(%r26), %r30
-
- ldw 80(%r26), %rp
-
- ldo 88(%r26),%r20
- fldds,ma 8(%r20), %fr12
- fldds,ma 8(%r20), %fr13
- fldds,ma 8(%r20), %fr14
- fldds,ma 8(%r20), %fr15
- fldds,ma 8(%r20), %fr16
- fldds,ma 8(%r20), %fr17
- fldds,ma 8(%r20), %fr18
- fldds,ma 8(%r20), %fr19
- fldds,ma 8(%r20), %fr20
- fldds 0(%r20), %fr21
-
- bv,n %r0(%r2)
- .procend
diff --git a/libc/ports/sysdeps/hppa/__longjmp.c b/libc/ports/sysdeps/hppa/__longjmp.c
new file mode 100644
index 000000000..8ad51055f
--- /dev/null
+++ b/libc/ports/sysdeps/hppa/__longjmp.c
@@ -0,0 +1,83 @@
+/* longjmp for PA-RISC.
+ Copyright (C) 1997-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 <setjmp.h>
+#include <stdlib.h>
+
+/* Jump to the position specified by ENV, causing the
+ setjmp call there to return VAL, or 1 if VAL is 0. */
+void
+__longjmp (__jmp_buf env, int val)
+{
+ /* We must use one of the non-callee saves registers
+ for env. */
+ register unsigned long r26 asm ("r26") = (unsigned long)&env[0];
+
+#ifdef CHECK_SP
+ CHECK_SP (env[0].__jmp_buf.__sp);
+#endif
+
+ asm volatile(
+ /* Set return value. */
+ "copy %0, %%r28\n\t"
+ /* Load callee saves from r3 to r18. */
+ "ldw 0(%1), %%r3\n\t"
+ "ldw 8(%1), %%r4\n\t"
+ "ldw 12(%1), %%r5\n\t"
+ "ldw 16(%1), %%r6\n\t"
+ "ldw 20(%1), %%r7\n\t"
+ "ldw 24(%1), %%r8\n\t"
+ "ldw 28(%1), %%r9\n\t"
+ "ldw 32(%1), %%r10\n\t"
+ "ldw 36(%1), %%r11\n\t"
+ "ldw 40(%1), %%r12\n\t"
+ "ldw 44(%1), %%r13\n\t"
+ "ldw 48(%1), %%r14\n\t"
+ "ldw 52(%1), %%r15\n\t"
+ "ldw 56(%1), %%r16\n\t"
+ "ldw 60(%1), %%r17\n\t"
+ "ldw 64(%1), %%r18\n\t"
+ /* Load PIC register. */
+ "ldw 68(%1), %%r19\n\t"
+ /* Load static link register. */
+ "ldw 72(%1), %%r27\n\t"
+ /* Load stack pointer. */
+ "ldw 76(%1), %%r30\n\t"
+ /* Load return pointer. */
+ "ldw 80(%1), %%rp\n\t"
+ /* Ues a spare caller saves register. */
+ "ldo 88(%1),%%r20\n\t"
+ /* Load callee saves from fr12 to fr21. */
+ "fldds,ma 8(%%r20), %%fr12\n\t"
+ "fldds,ma 8(%%r20), %%fr13\n\t"
+ "fldds,ma 8(%%r20), %%fr14\n\t"
+ "fldds,ma 8(%%r20), %%fr15\n\t"
+ "fldds,ma 8(%%r20), %%fr16\n\t"
+ "fldds,ma 8(%%r20), %%fr17\n\t"
+ "fldds,ma 8(%%r20), %%fr18\n\t"
+ "fldds,ma 8(%%r20), %%fr19\n\t"
+ "fldds,ma 8(%%r20), %%fr20\n\t"
+ "fldds 0(%%r20), %%fr21\n\t"
+ /* Jump back to stored return address. */
+ "bv,n %%r0(%%r2)\n\t"
+ : /* No outputs. */
+ : "r" (val == 0 ? 1 : val), "r" (r26)
+ : /* No point in clobbers. */ );
+ /* Avoid `volatile function does return' warnings. */
+ for (;;);
+}
diff --git a/libc/ports/sysdeps/hppa/bits/setjmp.h b/libc/ports/sysdeps/hppa/bits/setjmp.h
index 19a0cfe62..7283cc16f 100644
--- a/libc/ports/sysdeps/hppa/bits/setjmp.h
+++ b/libc/ports/sysdeps/hppa/bits/setjmp.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2005, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2000-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
@@ -23,13 +23,38 @@
# error "Never include <bits/setjmp.h> directly; use <setjmp.h> instead."
#endif
-/* The previous bits/setjmp.h had __jmp_buf defined as a structure.
- We use an array of 'double' instead, to make writing the assembler
- easier, and to ensure proper alignment. Naturally, user code should
- not depend on either representation. */
-
#ifndef _ASM
-typedef double __jmp_buf[21];
+/* The entire jump buffer must be 168 bytes long and laid
+ out in exactly as follows for ABI consistency.
+ * 20 x 32-bit gprs, with 8-bytes of padding, arranged so:
+ - r3 (callee saves)
+ - 4 bytes of padding.
+ - r4-r18 (callee saves)
+ - r19 (PIC register)
+ - r27 (static link register)
+ - r30 (stcack pointer)
+ - r2 (return pointer)
+ - 4 bytes of padding.
+ * 10 x 64-bit fprs in this order:
+ - fr12-fr21 (callee saves)
+ Note: We have 8 bytes of free space for future uses. */
+typedef union
+ {
+ struct __jmp_buf_internal_tag
+ {
+ int __r3;
+ int __pad0;
+ int __r4_r18[15];
+ int __r19;
+ int __r27;
+ int __sp;
+ int __rp;
+ int __pad1;
+ double __fr12_fr21[10];
+ } __jmp_buf;
+ /* Legacy definition. Ensures double alignment for fpsrs. */
+ double __align[21];
+ } __jmp_buf[1];
#endif
#endif /* bits/setjmp.h */
diff --git a/libc/ports/sysdeps/hppa/fpu/fegetround.c b/libc/ports/sysdeps/hppa/fpu/fegetround.c
index 70d2e476f..d603e66f1 100644
--- a/libc/ports/sysdeps/hppa/fpu/fegetround.c
+++ b/libc/ports/sysdeps/hppa/fpu/fegetround.c
@@ -1,5 +1,5 @@
/* Return current rounding direction.
- Copyright (C) 2000 Free Software Foundation, Inc.
+ Copyright (C) 2000-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David Huggins-Daines <dhd@debian.org>, 2000
@@ -17,17 +17,10 @@
License along with the GNU C Library. If not, see
<http://www.gnu.org/licenses/>. */
-#include <fenv.h>
+#include <get-rounding-mode.h>
int
fegetround (void)
{
- union { unsigned long long l; unsigned int sw[2] } s;
-
- /* Get the current status word. */
- __asm__ ("fstd %%fr0,0(%1) \n\t"
- "fldd 0(%1),%%fr0 \n\t"
- : "=m" (s.l) : "r" (&s.l));
-
- return (s.sw[0] & FE_DOWNWARD);
+ return get_rounding_mode ();
}
diff --git a/libc/ports/sysdeps/hppa/fpu/feholdexcpt.c b/libc/ports/sysdeps/hppa/fpu/feholdexcpt.c
index 6e3cabd88..ad2b0d0b4 100644
--- a/libc/ports/sysdeps/hppa/fpu/feholdexcpt.c
+++ b/libc/ports/sysdeps/hppa/fpu/feholdexcpt.c
@@ -1,5 +1,5 @@
/* Store current floating-point environment and clear exceptions.
- Copyright (C) 2000 Free Software Foundation, Inc.
+ Copyright (C) 2000-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David Huggins-Daines <dhd@debian.org>, 2000
@@ -42,7 +42,7 @@ feholdexcept (fenv_t *envp)
/* Load the new environment. Note: fr0 must load last to enable T-bit
Thus we start bufptr at the end and work backwards */
- bufptr = (unsigned int)(clear.buf) + sizeof(unsigned int)*4;
+ bufptr = (unsigned long long *)((unsigned int)(clear.buf) + sizeof(unsigned int)*4);
__asm__ (
"fldd,mb -8(%0),%%fr0\n"
: : "r" (bufptr), "m" (clear) : "%r0");
diff --git a/libc/ports/sysdeps/hppa/fpu/fesetenv.c b/libc/ports/sysdeps/hppa/fpu/fesetenv.c
index e768bb2c3..7a09e4de7 100644
--- a/libc/ports/sysdeps/hppa/fpu/fesetenv.c
+++ b/libc/ports/sysdeps/hppa/fpu/fesetenv.c
@@ -40,7 +40,7 @@ fesetenv (const fenv_t *envp)
| (FE_ALL_EXCEPT << 27)
| FE_DOWNWARD);
if (envp == FE_DFL_ENV)
- ;
+ temp.env.__status_word = 0;
else if (envp == FE_NOMASK_ENV)
temp.env.__status_word |= FE_ALL_EXCEPT;
else
diff --git a/libc/ports/sysdeps/hppa/fpu/fpu_control.h b/libc/ports/sysdeps/hppa/fpu/fpu_control.h
new file mode 100644
index 000000000..60697975e
--- /dev/null
+++ b/libc/ports/sysdeps/hppa/fpu/fpu_control.h
@@ -0,0 +1,66 @@
+/* FPU control word definitions. HP-PARISC 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/>. */
+
+#ifndef _FPU_CONTROL_H
+#define _FPU_CONTROL_H
+
+/* Masking of interrupts */
+#define _FPU_MASK_PM 0x00000001 /* Inexact (I) */
+#define _FPU_MASK_UM 0x00000002 /* Underflow (U) */
+#define _FPU_MASK_OM 0x00000004 /* Overflow (O) */
+#define _FPU_MASK_ZM 0x00000008 /* Divide by zero (Z) */
+#define _FPU_MASK_IM 0x00000010 /* Invalid operation (V) */
+
+/* Masking of rounding modes. */
+#define _FPU_HPPA_MASK_RM 0x00000600 /* Rounding mode mask */
+/* Masking of interrupt enable bits. */
+#define _FPU_HPPA_MASK_INT 0x0000001f /* Interrupt mask */
+
+/* There are no reserved bits in the PA fpsr (though some are undefined). */
+#define _FPU_RESERVED 0x00000000
+/* Default is: No traps enabled, no flags set, round to nearest. */
+#define _FPU_DEFAULT 0x00000000
+/* Default + exceptions (FE_ALL_EXCEPT) enabled. */
+#define _FPU_IEEE (_FPU_DEFAULT | _FPU_HPPA_MASK_INT)
+
+/* Type of the control word. */
+typedef unsigned int fpu_control_t;
+
+/* Macros for accessing the hardware control word. */
+#define _FPU_GETCW(cw) \
+({ \
+ union { unsigned long long __fpreg; unsigned int __halfreg[2]; } __fullfp; \
+ /* Get the current status word. */ \
+ __asm__ ("fstd %%fr0,0(%1)\n\t" \
+ "fldd 0(%1),%%fr0\n\t" \
+ : "=m" (__fullfp.__fpreg) : "r" (&__fullfp.__fpreg) : "%r0"); \
+ __fullfp.__halfreg[0]; \
+})
+
+#define _FPU_SETCW(cw) \
+({ \
+ union { unsigned long long __fpreg; unsigned int __halfreg[2]; } __fullfp; \
+ __fullfp.__halfreg[0] = cw; \
+ __asm__ ("fldd 0(%1),%%fr0\n\t" \
+ : : "m" (__fullfp.__fpreg), "r" (__fullfp.__fpreg) : "%r0" ); \
+})
+
+/* Default control word set at startup. */
+extern fpu_control_t __fpu_control;
+
+#endif /* _FPU_CONTROL_H */
diff --git a/libc/ports/sysdeps/hppa/get-rounding-mode.h b/libc/ports/sysdeps/hppa/get-rounding-mode.h
new file mode 100644
index 000000000..16e56719f
--- /dev/null
+++ b/libc/ports/sysdeps/hppa/get-rounding-mode.h
@@ -0,0 +1,35 @@
+/* Determine floating-point rounding mode within libc. HP-PARISC 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/>. */
+
+#ifndef _HPPA_GET_ROUNDING_MODE_H
+#define _HPPA_GET_ROUNDING_MODE_H 1
+
+#include <fenv.h>
+#include <fpu_control.h>
+
+/* Return the floating-point rounding mode. */
+
+static inline int
+get_rounding_mode (void)
+{
+ fpu_control_t fc;
+ _FPU_GETCW (fc);
+ return fc & _FPU_HPPA_MASK_RM;
+}
+
+#endif /* get-rounding-mode.h */
diff --git a/libc/ports/sysdeps/hppa/setjmp.S b/libc/ports/sysdeps/hppa/setjmp.S
index 146e4d194..0f05fd995 100644
--- a/libc/ports/sysdeps/hppa/setjmp.S
+++ b/libc/ports/sysdeps/hppa/setjmp.S
@@ -1,5 +1,5 @@
/* setjmp for HPPA.
- Copyright (C) 1995, 1996, 1997, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1995-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
@@ -31,6 +31,8 @@
.callinfo
__sigsetjmp:
stw %r3, 0(%r26)
+ /* This padding exists for unknown historical reasons. */
+ /* 4 - 4 bytes of padding. */
stw %r4, 8(%r26)
stw %r5, 12(%r26)
stw %r6, 16(%r26)
@@ -51,7 +53,8 @@ __sigsetjmp:
stw %r30, 76(%r26)
stw %rp, 80(%r26)
-
+ /* This padding exists to ensure double alignment for fprs. */
+ /* 84 - 4 bytes of padding. */
ldo 88(%r26),%r1
fstds,ma %fr12, 8(%r1) /* 88 */
fstds,ma %fr13, 8(%r1) /* 96 */
@@ -63,6 +66,7 @@ __sigsetjmp:
fstds,ma %fr19, 8(%r1) /* 144 */
fstds,ma %fr20, 8(%r1) /* 152 */
fstds %fr21, 0(%r1) /* 160 */
+ /* Total of 168 bytes. */
b __sigjmp_save
nop
.procend
diff --git a/libc/ports/sysdeps/m68k/dl-machine.h b/libc/ports/sysdeps/m68k/dl-machine.h
index 4a1968c4f..b2914192d 100644
--- a/libc/ports/sysdeps/m68k/dl-machine.h
+++ b/libc/ports/sysdeps/m68k/dl-machine.h
@@ -1,6 +1,5 @@
/* Machine-dependent ELF dynamic relocation inline functions. m68k version.
- Copyright (C) 1996-2001, 2002, 2003, 2004, 2005, 2010, 2011
- Free Software Foundation, Inc.
+ Copyright (C) 1996-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
@@ -107,6 +106,7 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
}
#define ELF_MACHINE_RUNTIME_FIXUP_ARGS long int save_a0, long int save_a1
+#define ELF_MACHINE_RUNTIME_FIXUP_PARAMS save_a0, save_a1
/* Mask identifying addresses reserved for the user program,
diff --git a/libc/ports/sysdeps/m68k/dl-trampoline.S b/libc/ports/sysdeps/m68k/dl-trampoline.S
index 14bf8ed0a..01b00a699 100644
--- a/libc/ports/sysdeps/m68k/dl-trampoline.S
+++ b/libc/ports/sysdeps/m68k/dl-trampoline.S
@@ -130,7 +130,7 @@ _dl_runtime_profile:
#ifdef __mcoldfire__
tst.l %d1
beq 2f
-1: move.l (%a0)+, (%a1)+
+1: move.l (%a1)+, (%a0)+
subq.l #4,%d1
bne 1b
2:
diff --git a/libc/ports/sysdeps/m68k/m680x0/fpu/libm-test-ulps b/libc/ports/sysdeps/m68k/m680x0/fpu/libm-test-ulps
index 54d690990..a9e67a989 100644
--- a/libc/ports/sysdeps/m68k/m680x0/fpu/libm-test-ulps
+++ b/libc/ports/sysdeps/m68k/m680x0/fpu/libm-test-ulps
@@ -675,6 +675,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 (0x0.ffffffffffffffffp0 + 0x0.ffffffffffffffffp-15000 i) == -5.421010862427522170184200798202494495630e-20 + 3.548665303440282824232502561095699343814e-4516 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog (0x0.ffffffp0 + 0x0.ffffffp-100 i) == -5.960464655174753498633255797994360530379e-8 + 7.888609052210118054117285652827862296732e-31 i":
+float: 1
+ifloat: 1
Test "Imaginary part of: clog (0x1.000566p0 + 0x1.234p-10 i) == 8.298731898331237038231468223024422855654e-5 + 1.110938609507128729312743251313024793990e-3 i":
ildouble: 1
ldouble: 1
@@ -687,6 +693,30 @@ ldouble: 1
Test "Imaginary part of: clog (0x1.fp+16383 + 0x1p+16383 i) == 11356.60974243783798653123798337822335902 + 0.4764674194737066993385333770295162295856 i":
ildouble: 1
ldouble: 1
+Test "Imaginary part of: clog (0x11682p-23 + 0x7ffed1p-23 i) == 1.1723955140027907954461000991619077811832e-12 + 1.5622968405332756349813737986164832897108 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog (0x2dd46725bp-35 + 0x7783a1284p-35 i) == 4.4469229730850767799109418892826021157328e-20 + 1.2046235979300843056806465045930070146351 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog (0x5b06b680ea2ccp-52 + 0xef452b965da9fp-52 i) == 8.3076914081087805757422664530653247447136e-30 + 1.2072712126771536614482822173033535043206 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog (0x602fd5037c4792efp-64 + 0xed3e2086dcca80b8p-64 i) == -2.3362950222592964220878638677292132852104e-37 + 1.1856121127236268105413184264288408265852 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog (0x6b10b4f3520217b6p-64 + 0xe8893cbb449253a1p-64 i) == 2.4244570985709679851855191080208817099132e-37 + 1.1393074519572050614551047548718495655972 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog (0x8ecbf810c4ae6p-52 + 0xd479468b09a37p-52 i) == -9.7375017988218644730510244778042114638107e-30 + 0.9790637929494922564724108399524154766631 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog (0xa1f2c1p-24 + 0xc643aep-24 i) == -1.0480505352462576151523512837107080269981e-13 + 0.8858771987699967480545613322309315260313 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog (0xa4722f19346cp-51 + 0x7f9631c5e7f07p-51 i) == -6.2122796286154679676173624516405339768606e-30 + 1.4904138780720095276446375492434049214172 i":
+ildouble: 1
+ldouble: 1
Test "Real part of: clog (1.0 + 0x1.234566p-10 i) == 6.172834701221959432440126967147726538097e-7 + 1.111110564353742042376451655136933182201e-3 i":
float: 1
ifloat: 1
@@ -755,6 +785,17 @@ double: 1
idouble: 1
ildouble: 2
ldouble: 2
+Test "Real part of: clog10 (0x0.fffffffffffff8p0 + 0x0.fffffffffffff8p-1000 i) == -4.821637332766435821255375046554377090472e-17 + 4.053112396770095089737411317782466262176e-302 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog10 (0x0.ffffffffffffffffp0 + 0x0.ffffffffffffffffp-15000 i) == -2.354315103889861110220423157644627849164e-20 + 1.541165759405643564697852372112893034397e-4516 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog10 (0x0.ffffffp0 + 0x0.ffffffp-100 i) == -2.588596909321764128428416045209904492216e-8 + 3.425979381266895667295625489912064603415e-31 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
Test "Imaginary part of: clog10 (0x1.000566p0 + 0x1.234p-10 i) == 3.604093470239754109961125085078190708674e-5 + 4.824745078422174667425851670822596859720e-4 i":
double: 1
idouble: 1
@@ -769,9 +810,87 @@ ldouble: 1
Test "Imaginary part of: clog10 (0x1.234566p-50 + 1.0 i) == 2.217530356103816369479108963807448194409e-31 + 6.821881769209202348667823902864283966959e-1 i":
ildouble: 1
ldouble: 1
+Test "Real part of: clog10 (0x10673dd0f2481p-51 + 0x7ef1d17cefbd2p-51 i) == 1.3918041236396763648388478552321724382899e-29 + 0.6263795733790237053262025311642907438291 i":
+double: 1
+idouble: 1
+Test "Real part of: clog10 (0x1367a310575591p-54 + 0x3cfcc0a0541f60p-54 i) == 2.2081507730821788480616336165447731164865e-32 + 0.5484039935757001196548030312819898864760 i":
+double: 1
+idouble: 1
+Test "Real part of: clog10 (0x1a6p-10 + 0x3a5p-10 i) == -6.2126412844802358329771948751248003038444e-07 + 0.4977135139537443711784513409096950995985 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 "Real part of: clog10 (0x2818p-15 + 0x798fp-15 i) == 6.6737261053986614395049481326819059203910e-09 + 0.5438241985991753781478398141908629586460 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: clog10 (0x2818p-15 + 0x798fp-15 i) == 6.6737261053986614395049481326819059203910e-09 + 0.5438241985991753781478398141908629586460 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog10 (0x2dd46725bp-35 + 0x7783a1284p-35 i) == 1.9312741086596516918394613098872836703188e-20 + 0.5231613813514771042838490538484014771862 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog10 (0x2ede88p-23 + 0x771c3fp-23 i) == -1.9440841725722970687903291200493082253766e-13 + 0.5193774116724956222518530053006822210323 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (0x2ede88p-23 + 0x771c3fp-23 i) == -1.9440841725722970687903291200493082253766e-13 + 0.5193774116724956222518530053006822210323 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog10 (0x4447d7175p-35 + 0x6c445e00ap-35 i) == -6.4375803621988389731799033530075237868110e-21 + 0.4378257977686804492768642780897650927167 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (0x4447d7175p-35 + 0x6c445e00ap-35 i) == -6.4375803621988389731799033530075237868110e-21 + 0.4378257977686804492768642780897650927167 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog10 (0x4d4ep-15 + 0x6605p-15 i) == -7.0781945783414996953799915941870192015212e-09 + 0.4005747524909781155537088181659175147564 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (0x5b06b680ea2ccp-52 + 0xef452b965da9fp-52 i) == 3.6079845358966994996207055940336690133424e-30 + 0.5243112258263349992771652393178033846555 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (0x659b70ab7971bp-53 + 0x1f5d111e08abecp-53 i) == -1.0893543813872082317104059174982092534059e-30 + 0.5954257879188711495921161433751775633232 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (0x659feap-24 + 0xeaf6f9p-24 i) == 1.6200701438094619117335617123525612051457e-14 + 0.5049027913635038013499728086604870749732 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (0x6b10b4f3520217b6p-64 + 0xe8893cbb449253a1p-64 i) == 1.0529283395205396881397407610630442563938e-37 + 0.4947949395762683446121140513971996916447 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (0x81b7efa81fc35ad1p-65 + 0x1ef4b835f1c79d812p-65 i) == -4.3074341162203896332989394770760901408798e-39 + 0.5709443672155660428417571212549720987784 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog10 (0x8ecbf810c4ae6p-52 + 0xd479468b09a37p-52 i) == -4.2289432987513243393180377141513840878196e-30 + 0.4252020027092323591068799049905597805296 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (0x8ecbf810c4ae6p-52 + 0xd479468b09a37p-52 i) == -4.2289432987513243393180377141513840878196e-30 + 0.4252020027092323591068799049905597805296 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (0xa1f2c1p-24 + 0xc643aep-24 i) == -4.5516256421319921959681423447271490869664e-14 + 0.3847315790697197749315054516562206543710 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (0xa4722f19346cp-51 + 0x7f9631c5e7f07p-51 i) == -2.6979587627476803379953050733225113494503e-30 + 0.6472785229986997177606324374555347813105 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog10 (0xf2p-10 + 0x3e3p-10 i) == 2.6921240173351112953324592659528481616879e-06 + 0.5785726025799636431142862788413361783862 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (0xfe961079616p-45 + 0x1bc37e09e6d1p-45 i) == 2.3329549194675052736016290082882121135546e-26 + 0.4561756099441139182878993697611751382976 i":
+double: 1
+idouble: 1
Test "Imaginary part of: clog10 (1.0 + 0x1.234566p-10 i) == 2.680828048441605163181684680300513080769e-7 + 4.825491868832381486767558728169977751564e-4 i":
ildouble: 1
ldouble: 1
@@ -2191,6 +2310,46 @@ float: 1
ifloat: 1
ildouble: 1
ldouble: 1
+Test "y0 (0x1p-10) == -4.4865150767109739412411806297168793661098":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "y0 (0x1p-100) == -4.420092432563900590456563035154802121284e+1":
+float: 1
+ifloat: 1
+Test "y0 (0x1p-110) == -4.861363632869203777249475899390797503250e+1":
+float: 1
+ifloat: 1
+Test "y0 (0x1p-20) == -8.8992283012125827603076426611387876938160":
+float: 1
+ifloat: 1
+Test "y0 (0x1p-30) == -1.3311940304267782826037118027401817264906e+1":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "y0 (0x1p-40) == -1.7724652307320814696990854700366226762563e+1":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "y0 (0x1p-60) == -2.6550076313426878432849115782108205929120e+1":
+double: 1
+idouble: 1
+Test "y0 (0x1p-70) == -3.0962788316479910300778244424468159753887e+1":
+double: 1
+idouble: 1
+Test "y0 (0x1p-80) == -3.5375500319532942168707373066828113573541e+1":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "y0 (0x1p-90) == -3.9788212322585974036636501709188067393195e+1":
+float: 1
+ifloat: 1
Test "y0 (1.0) == 0.0882569642156769579829267660235151628":
ildouble: 1
ldouble: 1
@@ -2227,6 +2386,9 @@ idouble: 1
ifloat: 2
ildouble: 1
ldouble: 1
+Test "y1 (0x1p-10) == -6.5190099301063115047395187618929589514382e+02":
+float: 1
+ifloat: 1
Test "y1 (1.0) == -0.781212821300288716547150000047964821":
double: 1
idouble: 1
diff --git a/libc/ports/sysdeps/m68k/m680x0/fpu/s_atan.c b/libc/ports/sysdeps/m68k/m680x0/fpu/s_atan.c
index a7d8a296b..c7bba83f3 100644
--- a/libc/ports/sysdeps/m68k/m680x0/fpu/s_atan.c
+++ b/libc/ports/sysdeps/m68k/m680x0/fpu/s_atan.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1996-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
@@ -32,6 +32,4 @@ __CONCATX(__,FUNC) (x)
{
return __m81_u(__CONCATX(__,FUNC))(x);
}
-
-#define weak_aliasx(a,b) weak_alias(a,b)
-weak_aliasx (__CONCATX(__,FUNC), FUNC)
+weak_alias (__CONCATX(__,FUNC), FUNC)
diff --git a/libc/ports/sysdeps/m68k/m680x0/fpu/s_ccosh.c b/libc/ports/sysdeps/m68k/m680x0/fpu/s_ccosh.c
index b8360853f..40568208d 100644
--- a/libc/ports/sysdeps/m68k/m680x0/fpu/s_ccosh.c
+++ b/libc/ports/sysdeps/m68k/m680x0/fpu/s_ccosh.c
@@ -1,5 +1,5 @@
/* Complex cosine hyperbole function. m68k fpu version
- Copyright (C) 1997, 1999, 2010, 2012 Free Software Foundation, Inc.
+ Copyright (C) 1997-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>.
@@ -73,5 +73,4 @@ s(__ccosh) (__complex__ float_type x)
return retval;
}
-#define weak_aliasx(a,b) weak_alias(a,b)
-weak_aliasx (s(__ccosh), s(ccosh))
+weak_alias (s(__ccosh), s(ccosh))
diff --git a/libc/ports/sysdeps/m68k/m680x0/fpu/s_cexp.c b/libc/ports/sysdeps/m68k/m680x0/fpu/s_cexp.c
index c2a9f1d22..83750b643 100644
--- a/libc/ports/sysdeps/m68k/m680x0/fpu/s_cexp.c
+++ b/libc/ports/sysdeps/m68k/m680x0/fpu/s_cexp.c
@@ -1,5 +1,5 @@
/* Complex exponential function. m68k fpu version
- Copyright (C) 1997, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1997-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
@@ -133,5 +133,4 @@ s(__cexp) (__complex__ float_type x)
return retval;
}
-#define weak_aliasx(a,b) weak_alias(a,b)
-weak_aliasx (s(__cexp), s(cexp))
+weak_alias (s(__cexp), s(cexp))
diff --git a/libc/ports/sysdeps/m68k/m680x0/fpu/s_csin.c b/libc/ports/sysdeps/m68k/m680x0/fpu/s_csin.c
index dc468d40e..fb660867f 100644
--- a/libc/ports/sysdeps/m68k/m680x0/fpu/s_csin.c
+++ b/libc/ports/sysdeps/m68k/m680x0/fpu/s_csin.c
@@ -1,5 +1,5 @@
/* Complex sine function. m68k fpu version
- Copyright (C) 1997, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1997-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>.
@@ -64,5 +64,4 @@ s(__csin) (__complex__ float_type x)
return retval;
}
-#define weak_aliasx(a,b) weak_alias(a,b)
-weak_aliasx (s(__csin), s(csin))
+weak_alias (s(__csin), s(csin))
diff --git a/libc/ports/sysdeps/m68k/m680x0/fpu/s_csinh.c b/libc/ports/sysdeps/m68k/m680x0/fpu/s_csinh.c
index 29156586e..ffc2b000c 100644
--- a/libc/ports/sysdeps/m68k/m680x0/fpu/s_csinh.c
+++ b/libc/ports/sysdeps/m68k/m680x0/fpu/s_csinh.c
@@ -1,5 +1,5 @@
/* Complex sine hyperbole function. m68k fpu version
- Copyright (C) 1997, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1997-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>.
@@ -66,5 +66,4 @@ s(__csinh) (__complex__ float_type x)
return retval;
}
-#define weak_aliasx(a,b) weak_alias(a,b)
-weak_aliasx (s(__csinh), s(csinh))
+weak_alias (s(__csinh), s(csinh))
diff --git a/libc/ports/sysdeps/m68k/m680x0/fpu/s_expm1.c b/libc/ports/sysdeps/m68k/m680x0/fpu/s_expm1.c
index 6dac1cc1a..37793221a 100644
--- a/libc/ports/sysdeps/m68k/m680x0/fpu/s_expm1.c
+++ b/libc/ports/sysdeps/m68k/m680x0/fpu/s_expm1.c
@@ -38,6 +38,4 @@ CONCATX(__,FUNC) (float_type x)
__set_errno (ERANGE);
return __m81_u(CONCATX(__, FUNC)) (x);
}
-
-#define weak_aliasx(a, b) weak_alias(a, b)
-weak_aliasx (CONCATX(__, FUNC), FUNC)
+weak_alias (CONCATX(__, FUNC), FUNC)
diff --git a/libc/ports/sysdeps/m68k/m680x0/fpu/s_frexp.c b/libc/ports/sysdeps/m68k/m680x0/fpu/s_frexp.c
index b4493190f..df738407a 100644
--- a/libc/ports/sysdeps/m68k/m680x0/fpu/s_frexp.c
+++ b/libc/ports/sysdeps/m68k/m680x0/fpu/s_frexp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1997, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 1996-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
@@ -50,6 +50,4 @@ __CONCATX(__,FUNC) (float_type value, int *expptr)
: "0" (value), "dmi" (-iexponent));
return mantissa;
}
-
-#define weak_aliasx(a,b) weak_alias(a,b)
-weak_aliasx (__CONCATX(__,FUNC), FUNC)
+weak_alias (__CONCATX(__,FUNC), FUNC)
diff --git a/libc/ports/sysdeps/m68k/m680x0/fpu/s_isinf.c b/libc/ports/sysdeps/m68k/m680x0/fpu/s_isinf.c
index ff4d3b2b1..20872da53 100644
--- a/libc/ports/sysdeps/m68k/m680x0/fpu/s_isinf.c
+++ b/libc/ports/sysdeps/m68k/m680x0/fpu/s_isinf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1997, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 1996-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
@@ -35,5 +35,4 @@ __CONCATX(__,FUNC) (x)
#define hidden_defx(a) hidden_def(a)
hidden_defx(__CONCATX(__,FUNC))
-#define weak_aliasx(a,b) weak_alias(a,b)
-weak_aliasx (__CONCATX(__,FUNC), FUNC)
+weak_alias (__CONCATX(__,FUNC), FUNC)
diff --git a/libc/ports/sysdeps/m68k/m680x0/fpu/s_lrint.c b/libc/ports/sysdeps/m68k/m680x0/fpu/s_lrint.c
index da2ea53bb..443b05cea 100644
--- a/libc/ports/sysdeps/m68k/m680x0/fpu/s_lrint.c
+++ b/libc/ports/sysdeps/m68k/m680x0/fpu/s_lrint.c
@@ -1,6 +1,6 @@
/* Round argument to nearest integral value according to current rounding
direction.
- Copyright (C) 1997 Free Software Foundation, Inc.
+ Copyright (C) 1997-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
@@ -34,6 +34,4 @@ CONCATX(__lrint,suffix) (float_type x)
{
return __m81_u(CONCATX(__lrint,suffix)) (x);
}
-
-#define weak_aliasx(a,b) weak_alias(a,b)
-weak_aliasx (CONCATX(__lrint,suffix), CONCATX(lrint,suffix))
+weak_alias (CONCATX(__lrint,suffix), CONCATX(lrint,suffix))
diff --git a/libc/ports/sysdeps/m68k/m680x0/fpu/s_modf.c b/libc/ports/sysdeps/m68k/m680x0/fpu/s_modf.c
index 95bc0ef21..2520431df 100644
--- a/libc/ports/sysdeps/m68k/m680x0/fpu/s_modf.c
+++ b/libc/ports/sysdeps/m68k/m680x0/fpu/s_modf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc.
+/* Copyright (C) 1996-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
@@ -50,6 +50,4 @@ s(__modf) (float_type x, float_type *iptr)
result = x - x_int;
return result;
}
-
-#define weak_aliasx(a,b) weak_alias(a,b)
-weak_aliasx(s(__modf), s(modf))
+weak_alias (s(__modf), s(modf))
diff --git a/libc/ports/sysdeps/m68k/m680x0/fpu/s_remquo.c b/libc/ports/sysdeps/m68k/m680x0/fpu/s_remquo.c
index 1395f7e01..0f052224e 100644
--- a/libc/ports/sysdeps/m68k/m680x0/fpu/s_remquo.c
+++ b/libc/ports/sysdeps/m68k/m680x0/fpu/s_remquo.c
@@ -1,5 +1,5 @@
/* Compute remainder and a congruent to the quotient. m68k fpu version
- Copyright (C) 1997 Free Software Foundation, Inc.
+ Copyright (C) 1997-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
@@ -43,5 +43,4 @@ s(__remquo) (float_type x, float_type y, int *quo)
*quo = cquo;
return result;
}
-#define weak_aliasx(a,b) weak_alias(a,b)
-weak_aliasx (s(__remquo), s(remquo))
+weak_alias (s(__remquo), s(remquo))
diff --git a/libc/ports/sysdeps/m68k/m680x0/fpu/s_scalbn.c b/libc/ports/sysdeps/m68k/m680x0/fpu/s_scalbn.c
index 796aeb2b1..ce1b92a22 100644
--- a/libc/ports/sysdeps/m68k/m680x0/fpu/s_scalbn.c
+++ b/libc/ports/sysdeps/m68k/m680x0/fpu/s_scalbn.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1996-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
@@ -45,9 +45,6 @@ __CONCATX(__scalbn,suffix) (x, exp)
{
return __m81_u(__CONCATX(__scalbn,suffix))(x, exp);
}
-
-#define weak_aliasx(a,b) weak_alias(a,b)
-#define strong_aliasx(a,b) strong_alias(a,b)
-weak_aliasx (__CONCATX(__scalbn,suffix), __CONCATX(scalbn,suffix))
-strong_aliasx (__CONCATX(__scalbn,suffix), __CONCATX(__scalbln,suffix))
-weak_aliasx (__CONCATX(__scalbn,suffix), __CONCATX(scalbln,suffix))
+weak_alias (__CONCATX(__scalbn,suffix), __CONCATX(scalbn,suffix))
+strong_alias (__CONCATX(__scalbn,suffix), __CONCATX(__scalbln,suffix))
+weak_alias (__CONCATX(__scalbn,suffix), __CONCATX(scalbln,suffix))
diff --git a/libc/ports/sysdeps/m68k/m680x0/fpu/s_sin.c b/libc/ports/sysdeps/m68k/m680x0/fpu/s_sin.c
index 4f9b65946..1ea3dda69 100644
--- a/libc/ports/sysdeps/m68k/m680x0/fpu/s_sin.c
+++ b/libc/ports/sysdeps/m68k/m680x0/fpu/s_sin.c
@@ -35,6 +35,4 @@ CONCATX(__,FUNC) (float_type x)
__set_errno (EDOM);
return __m81_u(CONCATX(__, FUNC)) (x);
}
-
-#define weak_aliasx(a, b) weak_alias(a, b)
-weak_aliasx (CONCATX(__, FUNC), FUNC)
+weak_alias (CONCATX(__, FUNC), FUNC)
diff --git a/libc/ports/sysdeps/m68k/m680x0/fpu/s_sincos.c b/libc/ports/sysdeps/m68k/m680x0/fpu/s_sincos.c
index 5e10db231..f7a40a370 100644
--- a/libc/ports/sysdeps/m68k/m680x0/fpu/s_sincos.c
+++ b/libc/ports/sysdeps/m68k/m680x0/fpu/s_sincos.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1997-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
@@ -32,6 +32,4 @@ CONCATX(__,FUNC) (x, sinx, cosx)
{
__m81_u(CONCATX(__,FUNC))(x, sinx, cosx);
}
-
-#define weak_aliasx(a,b) weak_alias(a,b)
-weak_aliasx (CONCATX(__,FUNC), FUNC)
+weak_alias (CONCATX(__,FUNC), FUNC)
diff --git a/libc/ports/sysdeps/m68k/sotruss-lib.c b/libc/ports/sysdeps/m68k/sotruss-lib.c
new file mode 100644
index 000000000..6c9e552b2
--- /dev/null
+++ b/libc/ports/sysdeps/m68k/sotruss-lib.c
@@ -0,0 +1,51 @@
+/* Override generic sotruss-lib.c to define actual functions for m68k.
+ 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/>. */
+
+#define HAVE_ARCH_PLTENTER
+#define HAVE_ARCH_PLTEXIT
+
+#include <elf/sotruss-lib.c>
+
+ElfW(Addr)
+la_m68k_gnu_pltenter (Elf32_Sym *sym __attribute__ ((unused)),
+ unsigned int ndx __attribute__ ((unused)),
+ uintptr_t *refcook, uintptr_t *defcook,
+ La_m68k_regs *regs, unsigned int *flags,
+ const char *symname, long int *framesizep)
+{
+ unsigned long int *sp = (unsigned long int *) regs->lr_sp;
+
+ print_enter (refcook, defcook, symname, sp[1], sp[2], sp[3], *flags);
+
+ /* No need to copy anything, we will not need the parameters in any case. */
+ *framesizep = 0;
+
+ return sym->st_value;
+}
+
+unsigned int
+la_m68k_gnu_pltexit (Elf32_Sym *sym, unsigned int ndx, uintptr_t *refcook,
+ uintptr_t *defcook,
+ const struct La_m68k_regs *inregs,
+ struct La_m68k_retval *outregs,
+ const char *symname)
+{
+ print_exit (refcook, defcook, symname, outregs->lrv_d0);
+
+ return 0;
+}
diff --git a/libc/ports/sysdeps/mips/bits/atomic.h b/libc/ports/sysdeps/mips/bits/atomic.h
index c5a26b927..3466df749 100644
--- a/libc/ports/sysdeps/mips/bits/atomic.h
+++ b/libc/ports/sysdeps/mips/bits/atomic.h
@@ -209,10 +209,10 @@ typedef uintmax_t uatomic_max_t;
in which values are returned. */
# define __arch_compare_and_exchange_xxx_8_int(mem, newval, oldval, rel, acq) \
- (abort (), __prev = __cmp = 0)
+ (abort (), __prev = 0, __cmp = 0, (void) __cmp)
# define __arch_compare_and_exchange_xxx_16_int(mem, newval, oldval, rel, acq) \
- (abort (), __prev = __cmp = 0)
+ (abort (), __prev = 0, __cmp = 0, (void) __cmp)
# define __arch_compare_and_exchange_xxx_32_int(mem, newval, oldval, rel, acq) \
__asm__ __volatile__ ( \
@@ -236,7 +236,7 @@ typedef uintmax_t uatomic_max_t;
# if _MIPS_SIM == _ABIO32
/* We can't do an atomic 64-bit operation in O32. */
# define __arch_compare_and_exchange_xxx_64_int(mem, newval, oldval, rel, acq) \
- (abort (), __prev = __cmp = 0)
+ (abort (), __prev = 0, __cmp = 0, (void) __cmp)
# else
# define __arch_compare_and_exchange_xxx_64_int(mem, newval, oldval, rel, acq) \
__asm__ __volatile__ ("\n" \
diff --git a/libc/ports/sysdeps/mips/dl-machine.h b/libc/ports/sysdeps/mips/dl-machine.h
index cc7da7625..9b970a26e 100644
--- a/libc/ports/sysdeps/mips/dl-machine.h
+++ b/libc/ports/sysdeps/mips/dl-machine.h
@@ -637,7 +637,7 @@ elf_machine_got_rel (struct link_map *map, int lazy)
#define RESOLVE_GOTSYM(sym,vernum,sym_index,reloc) \
({ \
const ElfW(Sym) *ref = sym; \
- const struct r_found_version *version \
+ const struct r_found_version *version __attribute__ ((unused)) \
= vernum ? &map->l_versions[vernum[sym_index] & 0x7fff] : NULL; \
struct link_map *sym_map; \
sym_map = RESOLVE_MAP (&ref, version, reloc); \
diff --git a/libc/ports/sysdeps/mips/jmpbuf-unwind.h b/libc/ports/sysdeps/mips/jmpbuf-unwind.h
index 31c9c8de7..355ca56f7 100644
--- a/libc/ports/sysdeps/mips/jmpbuf-unwind.h
+++ b/libc/ports/sysdeps/mips/jmpbuf-unwind.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003, 2005, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2003-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
@@ -25,13 +25,15 @@
#define _JMPBUF_UNWINDS(jmpbuf, address, demangle) \
((void *) (address) < (void *) demangle ((jmpbuf)[0].__sp))
-#define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \
- _JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj)
+#define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \
+ _JMPBUF_UNWINDS_ADJ (_jmpbuf, \
+ (void *) (_Unwind_Ptr) _Unwind_GetCFA (_context), \
+ _adj)
static inline uintptr_t __attribute__ ((unused))
_jmpbuf_sp (__jmp_buf regs)
{
- uintptr_t sp = regs[0].__sp;
+ uintptr_t sp = (uintptr_t) regs[0].__sp;
#ifdef PTR_DEMANGLE
PTR_DEMANGLE (sp);
#endif
diff --git a/libc/ports/sysdeps/mips/mips32/libm-test-ulps b/libc/ports/sysdeps/mips/mips32/libm-test-ulps
index 51356dddb..e0c7e0d47 100644
--- a/libc/ports/sysdeps/mips/mips32/libm-test-ulps
+++ b/libc/ports/sysdeps/mips/mips32/libm-test-ulps
@@ -72,6 +72,9 @@ ifloat: 1
Test "atan2 (-0.75, -1.0) == -2.49809154479650885165983415456218025":
float: 1
ifloat: 1
+Test "atan2 (-max_value, -min_value) == -pi/2":
+float: 1
+ifloat: 1
Test "atan2 (0.75, -1.0) == 2.49809154479650885165983415456218025":
float: 1
ifloat: 1
@@ -519,7 +522,43 @@ float: 2
ifloat: 2
# clog
-Test "Real part of: clog (0.75 + 1.25 i) == 0.376885901188190075998919126749298416 + 1.03037682652431246378774332703115153 i":
+Test "Real part of: clog (-0x1.0000000123456p0 + 0x1.2345678p-1000 i) == 2.649094276923003995420209214900915462737e-10 + 3.141592653589793238462643383279502884197 i":
+double: 1
+idouble: 1
+Test "Real part of: clog (-0x1.0000000123456p0 + 0x1.2345678p-30 i) == 2.649094282537168795982991778475646793277e-10 + 3.141592652530155111500161671113150737892 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog (-0x1.234566p-40 - 1.0 i) == 5.354083939753840089583620652120903838944e-25 - 1.570796326795931422008642456283782656359 i":
+float: 1
+ifloat: 1
+Test "Real part of: clog (-0x1.fp+127 + 0x1p-149 i) == 88.69109041335841930424871526389807508374 + pi i":
+float: 1
+ifloat: 1
+Test "Real part of: clog (-0x1.fp+127 - 0x1p-149 i) == 88.69109041335841930424871526389807508374 - pi i":
+float: 1
+ifloat: 1
+Test "Real part of: clog (-0x1p-149 + 0x1.fp+127 i) == 88.69109041335841930424871526389807508374 + pi/2 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: clog (-0x1p-149 + 0x1.fp+127 i) == 88.69109041335841930424871526389807508374 + pi/2 i":
+float: 1
+ifloat: 1
+Test "Real part of: clog (-0x1p-149 - 0x1.fp+127 i) == 88.69109041335841930424871526389807508374 - pi/2 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: clog (-0x1p-149 - 0x1.fp+127 i) == 88.69109041335841930424871526389807508374 - pi/2 i":
+float: 1
+ifloat: 1
+Test "Real part of: clog (0x0.ffffffp0 + 0x0.ffffffp-100 i) == -5.960464655174753498633255797994360530379e-8 + 7.888609052210118054117285652827862296732e-31 i":
+float: 1
+ifloat: 1
+Test "Real part of: clog (0x1.000566p0 + 0x1.234p-10 i) == 8.298731898331237038231468223024422855654e-5 + 1.110938609507128729312743251313024793990e-3 i":
+float: 1
+ifloat: 1
+Test "Real part of: clog (0x1.fp+127 + 0x1p-149 i) == 88.69109041335841930424871526389807508374 + +0 i":
+float: 1
+ifloat: 1
+Test "Real part of: clog (0x1.fp+127 - 0x1p-149 i) == 88.69109041335841930424871526389807508374 - 0 i":
float: 1
ifloat: 1
Test "Real part of: clog (0x1p-1074 + 0x1p-1074 i) == -744.0934983311012896593986823853525458290 + pi/4 i":
@@ -528,6 +567,18 @@ idouble: 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 + 0x1.fp+127 i) == 88.69109041335841930424871526389807508374 + pi/2 i":
+float: 1
+ifloat: 1
+Test "Real part of: clog (0x1p-149 - 0x1.fp+127 i) == 88.69109041335841930424871526389807508374 - pi/2 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: clog (0x2818p-15 + 0x798fp-15 i) == 1.5366822245016167178749091974664853785194e-08 + 1.2522014929038946066987318471922169174157 i":
+float: 1
+ifloat: 1
+Test "Real part of: clog (1.0 + 0x1.234566p-10 i) == 6.172834701221959432440126967147726538097e-7 + 1.111110564353742042376451655136933182201e-3 i":
+float: 1
+ifloat: 1
# clog10
Test "Imaginary part of: clog10 (-0 + inf i) == inf + pi/2*log10(e) i":
@@ -536,6 +587,49 @@ ifloat: 1
Test "Imaginary part of: clog10 (-0 - inf i) == inf - pi/2*log10(e) i":
float: 1
ifloat: 1
+Test "Real part of: clog10 (-0x1.0000000123456p0 + 0x1.2345678p-1000 i) == 1.150487026509145544402795327729455391948e-10 + 1.364376353841841347485783625431355770210 i":
+double: 2
+idouble: 2
+Test "Imaginary part of: clog10 (-0x1.0000000123456p0 + 0x1.2345678p-1000 i) == 1.150487026509145544402795327729455391948e-10 + 1.364376353841841347485783625431355770210 i":
+double: 1
+idouble: 1
+Test "Real part of: clog10 (-0x1.0000000123456p0 + 0x1.2345678p-30 i) == 1.150487028947346337782682105935961875822e-10 + 1.364376353381646356131680448946397884147 i":
+double: 2
+idouble: 2
+Test "Imaginary part of: clog10 (-0x1.0000000123456p0 + 0x1.2345678p-30 i) == 1.150487028947346337782682105935961875822e-10 + 1.364376353381646356131680448946397884147 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (-0x1.fp+1023 + 0x1p-1074 i) == 308.2409272754311106024666378243768099991 + 1.364376353841841347485783625431355770210 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (-0x1.fp+1023 - 0x1p-1074 i) == 308.2409272754311106024666378243768099991 - 1.364376353841841347485783625431355770210 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (-0x1.fp+127 + 0x1p-149 i) == 38.51805116050395969095658815123105801479 + 1.364376353841841347485783625431355770210 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Imaginary part of: clog10 (-0x1.fp+127 - 0x1p-149 i) == 38.51805116050395969095658815123105801479 - 1.364376353841841347485783625431355770210 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Imaginary part of: clog10 (-0x1p-1074 + 0x1.fp+1023 i) == 308.2409272754311106024666378243768099991 + 0.6821881769209206737428918127156778851051 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (-0x1p-1074 - 0x1.fp+1023 i) == 308.2409272754311106024666378243768099991 - 0.6821881769209206737428918127156778851051 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (-0x1p-149 + 0x1.fp+127 i) == 38.51805116050395969095658815123105801479 + 0.6821881769209206737428918127156778851051 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (-0x1p-149 - 0x1.fp+127 i) == 38.51805116050395969095658815123105801479 - 0.6821881769209206737428918127156778851051 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (-1.0 + 0x1.234566p-20 i) == 2.556638434669064077889576526006849923281e-13 + 1.364375882602207106407956770293808181427 i":
+double: 1
+idouble: 1
Test "Imaginary part of: clog10 (-2 - 3 i) == 0.556971676153418384603252578971164214 - 0.937554462986374708541507952140189646 i":
double: 1
idouble: 1
@@ -563,24 +657,142 @@ ifloat: 1
Test "Imaginary part of: clog10 (0 - inf i) == inf - pi/2*log10(e) i":
float: 1
ifloat: 1
-Test "Real part of: clog10 (0.75 + 1.25 i) == 0.163679467193165171449476605077428975 + 0.447486970040493067069984724340855636 i":
+Test "Real part of: clog10 (0x0.fffffffffffff8p0 + 0x0.fffffffffffff8p-1000 i) == -4.821637332766435821255375046554377090472e-17 + 4.053112396770095089737411317782466262176e-302 i":
+double: 1
+idouble: 1
+Test "Real part of: clog10 (0x0.ffffffp0 + 0x0.ffffffp-100 i) == -2.588596909321764128428416045209904492216e-8 + 3.425979381266895667295625489912064603415e-31 i":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+Test "Real part of: clog10 (0x1.000566p0 + 0x1.234p-10 i) == 3.604093470239754109961125085078190708674e-5 + 4.824745078422174667425851670822596859720e-4 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: clog10 (0x1.000566p0 + 0x1.234p-10 i) == 3.604093470239754109961125085078190708674e-5 + 4.824745078422174667425851670822596859720e-4 i":
+double: 1
+idouble: 1
+Test "Real part of: clog10 (0x1.000566p0 + 0x1.234p-100 i) == 3.577293486783822178310971763308187385546e-5 + 3.897399639875661463735636919790792140598e-31 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: clog10 (0x1.234566p-30 + 1.0 i) == 2.438200411482400072282924063740535840474e-19 + 6.821881764607257184291586401763604544928e-1 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: clog10 (0x1.234566p-50 + 1.0 i) == 2.217530356103816369479108963807448194409e-31 + 6.821881769209202348667823902864283966959e-1 i":
float: 1
ifloat: 1
+Test "Imaginary part of: clog10 (0x1.234566p-60 + 1.0 i) == 2.114801746467415208319767917450504756866e-37 + 6.821881769209206733143018621078368211515e-1 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
Test "Imaginary part of: clog10 (0x1.fffffep+127 + 0x1.fffffep+127 i) == 38.68235441693561449174780668781319348761 + pi/4*log10(e) i":
float: 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 "Real part of: clog10 (0x10673dd0f2481p-51 + 0x7ef1d17cefbd2p-51 i) == 1.3918041236396763648388478552321724382899e-29 + 0.6263795733790237053262025311642907438291 i":
+double: 1
+idouble: 1
+Test "Real part of: clog10 (0x1367a310575591p-54 + 0x3cfcc0a0541f60p-54 i) == 2.2081507730821788480616336165447731164865e-32 + 0.5484039935757001196548030312819898864760 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (0x1367a310575591p-54 + 0x3cfcc0a0541f60p-54 i) == 2.2081507730821788480616336165447731164865e-32 + 0.5484039935757001196548030312819898864760 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (0x164c74eea876p-45 + 0x16f393482f77p-45 i) == -1.3155760824064879362415202279780039150764e-26 + 0.3473590599762514228227328130640352044313 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (0x1a6p-10 + 0x3a5p-10 i) == -6.2126412844802358329771948751248003038444e-07 + 0.4977135139537443711784513409096950995985 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (0x1p-1074 + 0x1.fp+1023 i) == 308.2409272754311106024666378243768099991 + 0.6821881769209206737428918127156778851051 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 - 0x1.fp+1023 i) == 308.2409272754311106024666378243768099991 - 0.6821881769209206737428918127156778851051 i":
+double: 1
+idouble: 1
Test "Imaginary part of: clog10 (0x1p-147 + 0x1p-147 i) == -44.10089436477324509881274807713822842154 + pi/4*log10(e) i":
float: 1
ifloat: 1
+Test "Imaginary part of: clog10 (0x1p-149 + 0x1.fp+127 i) == 38.51805116050395969095658815123105801479 + 0.6821881769209206737428918127156778851051 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":
float: 1
ifloat: 1
+Test "Imaginary part of: clog10 (0x1p-149 - 0x1.fp+127 i) == 38.51805116050395969095658815123105801479 - 0.6821881769209206737428918127156778851051 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Imaginary part of: clog10 (0x1p-509 + 1.0 i) == 7.730698388614835910296270976605350994446e-308 + 6.821881769209206737428918127156778851051e-1 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (0x1p-510 + 1.0 i) == 1.932674597153708977574067744151337748612e-308 + 6.821881769209206737428918127156778851051e-1 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (0x1p-511 + 1.0 i) == 4.831686492884272443935169360378344371529e-309 + 6.821881769209206737428918127156778851051e-1 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (0x1p-61 + 1.0 i) == 4.084085680564517578238994467153626207224e-38 + 6.821881769209206735545466044044889962925e-1 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Imaginary part of: clog10 (0x1p-62 + 1.0 i) == 1.021021420141129394559748616788406551878e-38 + 6.821881769209206736487192085600834406988e-1 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Imaginary part of: clog10 (0x1p-63 + 1.0 i) == 2.552553550352823486399371541971016379740e-39 + 6.821881769209206736958055106378806629019e-1 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Real part of: clog10 (0x2818p-15 + 0x798fp-15 i) == 6.6737261053986614395049481326819059203910e-09 + 0.5438241985991753781478398141908629586460 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Imaginary part of: clog10 (0x2818p-15 + 0x798fp-15 i) == 6.6737261053986614395049481326819059203910e-09 + 0.5438241985991753781478398141908629586460 i":
+float: 1
+ifloat: 1
+Test "Real part of: clog10 (0x2dd46725bp-35 + 0x7783a1284p-35 i) == 1.9312741086596516918394613098872836703188e-20 + 0.5231613813514771042838490538484014771862 i":
+double: 1
+idouble: 1
+Test "Real part of: clog10 (0x2ede88p-23 + 0x771c3fp-23 i) == -1.9440841725722970687903291200493082253766e-13 + 0.5193774116724956222518530053006822210323 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: clog10 (0x2ede88p-23 + 0x771c3fp-23 i) == -1.9440841725722970687903291200493082253766e-13 + 0.5193774116724956222518530053006822210323 i":
+double: 1
+idouble: 1
+Test "Real part of: clog10 (0x4447d7175p-35 + 0x6c445e00ap-35 i) == -6.4375803621988389731799033530075237868110e-21 + 0.4378257977686804492768642780897650927167 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (0x5b06b680ea2ccp-52 + 0xef452b965da9fp-52 i) == 3.6079845358966994996207055940336690133424e-30 + 0.5243112258263349992771652393178033846555 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (0x9b57bp-20 + 0xcb7b4p-20 i) == -1.7182001068739620267773842120965071561416e-11 + 0.3990121149225253562859800593935899629087 i":
+double: 1
+idouble: 1
+Test "Real part of: clog10 (0xf2p-10 + 0x3e3p-10 i) == 2.6921240173351112953324592659528481616879e-06 + 0.5785726025799636431142862788413361783862 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (0xf2p-10 + 0x3e3p-10 i) == 2.6921240173351112953324592659528481616879e-06 + 0.5785726025799636431142862788413361783862 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (0xfe961079616p-45 + 0x1bc37e09e6d1p-45 i) == 2.3329549194675052736016290082882121135546e-26 + 0.4561756099441139182878993697611751382976 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (1.0 + 0x1.234566p-10 i) == 2.680828048441605163181684680300513080769e-7 + 4.825491868832381486767558728169977751564e-4 i":
+double: 1
+idouble: 1
Test "Imaginary part of: clog10 (3 + inf i) == inf + pi/2*log10(e) i":
float: 1
ifloat: 1
@@ -595,6 +807,12 @@ float: 1
ifloat: 1
# cos
+Test "cos (0x1p+120) == -9.25879022854837867303861764107414946730833e-01":
+float: 1
+ifloat: 1
+Test "cos (0x1p+127) == 7.81914638714960072263910298466369236613162e-01":
+float: 1
+ifloat: 1
Test "cos (M_PI_6l * 2.0) == 0.5":
double: 1
idouble: 1
@@ -689,9 +907,6 @@ ifloat: 1
Test "Real part of: cpow (0.75 + 1.25 i, 0.0 + 1.0 i) == 0.331825439177608832276067945276730566 + 0.131338600281188544930936345230903032 i":
float: 1
ifloat: 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
Test "Real part of: cpow (0.75 + 1.25 i, 0.75 + 1.25 i) == 0.117506293914473555420279832210420483 + 0.346552747708338676483025352060418001 i":
double: 1
float: 4
@@ -784,12 +999,18 @@ float: 1
ifloat: 1
# csqrt
+Test "Real part of: csqrt (-0x1.000002p-126 - 0x1.000002p-126 i) == 4.934094449071842328766868579214125217132e-20 - 1.191195773697904627170323731331667740087e-19 i":
+double: 1
+idouble: 1
Test "Real part of: csqrt (-2 + 3 i) == 0.89597747612983812471573375529004348 + 1.6741492280355400404480393008490519 i":
float: 1
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.000002p-126 + 0x1.000002p-126 i) == 1.191195773697904627170323731331667740087e-19 + 4.934094449071842328766868579214125217132e-20 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
@@ -823,6 +1044,47 @@ Test "Real part of: ctan (0x3.243f6cp-1 + 0 i) == -2.287733242885645987394874673
float: 1
ifloat: 1
+# ctan_downward
+Test "Real part of: ctan_downward (0x1.921fb6p+0 + 0x1p-149 i) == -2.287733242885645987394874673945769518150e7 + 7.334008549954377778731880988481078535821e-31 i":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+Test "Imaginary part of: ctan_downward (0x1.921fb6p+0 + 0x1p-149 i) == -2.287733242885645987394874673945769518150e7 + 7.334008549954377778731880988481078535821e-31 i":
+float: 1
+ifloat: 1
+
+# ctan_tonearest
+Test "Real part of: ctan_tonearest (0x1.921fb6p+0 + 0x1p-149 i) == -2.287733242885645987394874673945769518150e7 + 7.334008549954377778731880988481078535821e-31 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: ctan_tonearest (0x1.921fb6p+0 + 0x1p-149 i) == -2.287733242885645987394874673945769518150e7 + 7.334008549954377778731880988481078535821e-31 i":
+float: 1
+ifloat: 1
+
+# ctan_towardzero
+Test "Real part of: ctan_towardzero (0x1.921fb6p+0 + 0x1p-149 i) == -2.287733242885645987394874673945769518150e7 + 7.334008549954377778731880988481078535821e-31 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: ctan_towardzero (0x1.921fb6p+0 + 0x1p-149 i) == -2.287733242885645987394874673945769518150e7 + 7.334008549954377778731880988481078535821e-31 i":
+float: 1
+ifloat: 1
+
+# ctan_upward
+Test "Real part of: ctan_upward (0x1.921fb54442d18p+0 + 0x1p-1074 i) == 1.633123935319536975596773704152891653086e16 + 1.317719414943508315995636961402669067843e-291 i":
+double: 1
+idouble: 1
+Test "Real part of: ctan_upward (0x1.921fb6p+0 + 0x1p-149 i) == -2.287733242885645987394874673945769518150e7 + 7.334008549954377778731880988481078535821e-31 i":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+Test "Imaginary part of: ctan_upward (0x1.921fb6p+0 + 0x1p-149 i) == -2.287733242885645987394874673945769518150e7 + 7.334008549954377778731880988481078535821e-31 i":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
# ctanh
Test "Real part of: ctanh (-2 - 3 i) == -0.965385879022133124278480269394560686 + 0.988437503832249372031403430350121098e-2 i":
double: 1
@@ -857,6 +1119,47 @@ Test "Real part of: ctanh (1 + 0x1p127 i) == 0.910133404767618376153287379442647
double: 1
idouble: 1
+# ctanh_downward
+Test "Real part of: ctanh_downward (0x1p-149 + 0x1.921fb6p+0 i) == 7.334008549954377778731880988481078535821e-31 - 2.287733242885645987394874673945769518150e7 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: ctanh_downward (0x1p-149 + 0x1.921fb6p+0 i) == 7.334008549954377778731880988481078535821e-31 - 2.287733242885645987394874673945769518150e7 i":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+
+# ctanh_tonearest
+Test "Real part of: ctanh_tonearest (0x1p-149 + 0x1.921fb6p+0 i) == 7.334008549954377778731880988481078535821e-31 - 2.287733242885645987394874673945769518150e7 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: ctanh_tonearest (0x1p-149 + 0x1.921fb6p+0 i) == 7.334008549954377778731880988481078535821e-31 - 2.287733242885645987394874673945769518150e7 i":
+float: 1
+ifloat: 1
+
+# ctanh_towardzero
+Test "Real part of: ctanh_towardzero (0x1p-149 + 0x1.921fb6p+0 i) == 7.334008549954377778731880988481078535821e-31 - 2.287733242885645987394874673945769518150e7 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: ctanh_towardzero (0x1p-149 + 0x1.921fb6p+0 i) == 7.334008549954377778731880988481078535821e-31 - 2.287733242885645987394874673945769518150e7 i":
+float: 1
+ifloat: 1
+
+# ctanh_upward
+Test "Imaginary part of: ctanh_upward (0x1p-1074 + 0x1.921fb54442d18p+0 i) == 1.317719414943508315995636961402669067843e-291 + 1.633123935319536975596773704152891653086e16 i":
+double: 1
+idouble: 1
+Test "Real part of: ctanh_upward (0x1p-149 + 0x1.921fb6p+0 i) == 7.334008549954377778731880988481078535821e-31 - 2.287733242885645987394874673945769518150e7 i":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+Test "Imaginary part of: ctanh_upward (0x1p-149 + 0x1.921fb6p+0 i) == 7.334008549954377778731880988481078535821e-31 - 2.287733242885645987394874673945769518150e7 i":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+
# erf
Test "erf (1.25) == 0.922900128256458230136523481197281140":
double: 1
@@ -1215,6 +1518,12 @@ float: 1
ifloat: 1
# sincos
+Test "sincos (0x1p+120, &sin_res, &cos_res) puts -9.25879022854837867303861764107414946730833e-01 in cos_res":
+float: 1
+ifloat: 1
+Test "sincos (0x1p+127, &sin_res, &cos_res) puts 7.81914638714960072263910298466369236613162e-01 in cos_res":
+float: 1
+ifloat: 1
Test "sincos (M_PI_6l*2.0, &sin_res, &cos_res) puts 0.5 in cos_res":
double: 1
idouble: 1
@@ -1322,6 +1631,34 @@ idouble: 1
Test "y0 (0x1.ff00000000002p+840) == 1.846591691699331493194965158699937660696e-127":
double: 1
idouble: 1
+Test "y0 (0x1p-10) == -4.4865150767109739412411806297168793661098":
+double: 1
+idouble: 1
+Test "y0 (0x1p-110) == -4.861363632869203777249475899390797503250e+1":
+double: 1
+idouble: 1
+Test "y0 (0x1p-20) == -8.8992283012125827603076426611387876938160":
+float: 1
+ifloat: 1
+Test "y0 (0x1p-30) == -1.3311940304267782826037118027401817264906e+1":
+float: 1
+ifloat: 1
+Test "y0 (0x1p-40) == -1.7724652307320814696990854700366226762563e+1":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "y0 (0x1p-50) == -2.2137364310373846564919987139743760738155e+1":
+float: 1
+ifloat: 1
+Test "y0 (0x1p-70) == -3.0962788316479910300778244424468159753887e+1":
+double: 1
+idouble: 1
+Test "y0 (0x1p-80) == -3.5375500319532942168707373066828113573541e+1":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
Test "y0 (1.0) == 0.0882569642156769579829267660235151628":
double: 2
float: 1
@@ -1348,6 +1685,9 @@ idouble: 1
Test "y1 (0x1.27e204p+99) == -8.881610148467797208469612080785210013461e-16":
double: 1
idouble: 1
+Test "y1 (0x1p-10) == -6.5190099301063115047395187618929589514382e+02":
+double: 1
+idouble: 1
Test "y1 (1.5) == -0.412308626973911295952829820633445323":
float: 1
ifloat: 1
@@ -1582,12 +1922,16 @@ float: 1
idouble: 1
ifloat: 1
-Function: Real part of "clog10":
-double: 1
+Function: Imaginary part of "clog":
float: 1
-idouble: 1
ifloat: 1
+Function: Real part of "clog10":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
Function: Imaginary part of "clog10":
double: 1
float: 1
@@ -1674,6 +2018,44 @@ Function: Imaginary part of "ctan":
double: 1
idouble: 1
+Function: Real part of "ctan_downward":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+
+Function: Imaginary part of "ctan_downward":
+float: 1
+ifloat: 1
+
+Function: Real part of "ctan_tonearest":
+float: 1
+ifloat: 1
+
+Function: Imaginary part of "ctan_tonearest":
+float: 1
+ifloat: 1
+
+Function: Real part of "ctan_towardzero":
+float: 1
+ifloat: 1
+
+Function: Imaginary part of "ctan_towardzero":
+float: 1
+ifloat: 1
+
+Function: Real part of "ctan_upward":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+
+Function: Imaginary part of "ctan_upward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
Function: Real part of "ctanh":
double: 1
float: 1
@@ -1686,6 +2068,44 @@ float: 2
idouble: 1
ifloat: 2
+Function: Real part of "ctanh_downward":
+float: 1
+ifloat: 1
+
+Function: Imaginary part of "ctanh_downward":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+
+Function: Real part of "ctanh_tonearest":
+float: 1
+ifloat: 1
+
+Function: Imaginary part of "ctanh_tonearest":
+float: 1
+ifloat: 1
+
+Function: Real part of "ctanh_towardzero":
+float: 1
+ifloat: 1
+
+Function: Imaginary part of "ctanh_towardzero":
+float: 1
+ifloat: 1
+
+Function: Real part of "ctanh_upward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: Imaginary part of "ctanh_upward":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+
Function: "erf":
double: 1
idouble: 1
diff --git a/libc/ports/sysdeps/mips/mips64/libm-test-ulps b/libc/ports/sysdeps/mips/mips64/libm-test-ulps
index bc9464eb7..c7a18d666 100644
--- a/libc/ports/sysdeps/mips/mips64/libm-test-ulps
+++ b/libc/ports/sysdeps/mips/mips64/libm-test-ulps
@@ -77,6 +77,9 @@ float: 1
ifloat: 1
ildouble: 1
ldouble: 1
+Test "atan2 (-max_value, -min_value) == -pi/2":
+float: 1
+ifloat: 1
Test "atan2 (0.75, -1.0) == 2.49809154479650885165983415456218025":
float: 1
ifloat: 1
@@ -118,8 +121,6 @@ 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
@@ -156,8 +157,6 @@ 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
@@ -202,8 +201,6 @@ 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
@@ -219,8 +216,6 @@ 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
@@ -236,8 +231,6 @@ 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
@@ -253,8 +246,6 @@ 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
@@ -276,13 +267,9 @@ 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
@@ -291,13 +278,9 @@ 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":
@@ -324,8 +307,6 @@ 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
@@ -362,8 +343,6 @@ 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
@@ -473,13 +452,9 @@ 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
@@ -795,20 +770,161 @@ ildouble: 1
ldouble: 1
# clog
-Test "Real part of: clog (0.75 + 1.25 i) == 0.376885901188190075998919126749298416 + 1.03037682652431246378774332703115153 i":
+Test "Real part of: clog (-0x1.0000000123456p0 + 0x1.2345678p-1000 i) == 2.649094276923003995420209214900915462737e-10 + 3.141592653589793238462643383279502884197 i":
+double: 1
+idouble: 1
+Test "Real part of: clog (-0x1.0000000123456p0 + 0x1.2345678p-30 i) == 2.649094282537168795982991778475646793277e-10 + 3.141592652530155111500161671113150737892 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog (-0x1.234566p-40 - 1.0 i) == 5.354083939753840089583620652120903838944e-25 - 1.570796326795931422008642456283782656359 i":
+float: 1
+ifloat: 1
+Test "Real part of: clog (-0x1.fp+127 + 0x1p-149 i) == 88.69109041335841930424871526389807508374 + pi i":
float: 1
ifloat: 1
+Test "Real part of: clog (-0x1.fp+127 - 0x1p-149 i) == 88.69109041335841930424871526389807508374 - pi i":
+float: 1
+ifloat: 1
+Test "Real part of: clog (-0x1.fp+16383 + 0x1p-16445 i) == 11356.49165759582936919077408168801636572 + pi i":
ildouble: 1
ldouble: 1
+Test "Real part of: clog (-0x1.fp+16383 + 0x1p-16494 i) == 11356.49165759582936919077408168801636572 + pi i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog (-0x1.fp+16383 - 0x1p-16445 i) == 11356.49165759582936919077408168801636572 - pi i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog (-0x1.fp+16383 - 0x1p-16494 i) == 11356.49165759582936919077408168801636572 - pi i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog (-0x1p-149 + 0x1.fp+127 i) == 88.69109041335841930424871526389807508374 + pi/2 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: clog (-0x1p-149 + 0x1.fp+127 i) == 88.69109041335841930424871526389807508374 + pi/2 i":
+float: 1
+ifloat: 1
+Test "Real part of: clog (-0x1p-149 - 0x1.fp+127 i) == 88.69109041335841930424871526389807508374 - pi/2 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: clog (-0x1p-149 - 0x1.fp+127 i) == 88.69109041335841930424871526389807508374 - pi/2 i":
+float: 1
+ifloat: 1
+Test "Real part of: clog (-0x1p-16445 + 0x1.fp+16383 i) == 11356.49165759582936919077408168801636572 + pi/2 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog (-0x1p-16445 - 0x1.fp+16383 i) == 11356.49165759582936919077408168801636572 - pi/2 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog (-0x1p-16494 + 0x1.fp+16383 i) == 11356.49165759582936919077408168801636572 + pi/2 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog (-0x1p-16494 - 0x1.fp+16383 i) == 11356.49165759582936919077408168801636572 - pi/2 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog (0x0.ffffffp0 + 0x0.ffffffp-100 i) == -5.960464655174753498633255797994360530379e-8 + 7.888609052210118054117285652827862296732e-31 i":
+float: 1
+ifloat: 1
+Test "Real part of: clog (0x1.000566p0 + 0x1.234p-10 i) == 8.298731898331237038231468223024422855654e-5 + 1.110938609507128729312743251313024793990e-3 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: clog (0x1.000566p0 + 0x1.234p-10 i) == 8.298731898331237038231468223024422855654e-5 + 1.110938609507128729312743251313024793990e-3 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog (0x1.fp+127 + 0x1p-149 i) == 88.69109041335841930424871526389807508374 + +0 i":
+float: 1
+ifloat: 1
+Test "Real part of: clog (0x1.fp+127 - 0x1p-149 i) == 88.69109041335841930424871526389807508374 - 0 i":
+float: 1
+ifloat: 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-16445 i) == 11356.49165759582936919077408168801636572 + +0 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog (0x1.fp+16383 + 0x1p-16494 i) == 11356.49165759582936919077408168801636572 + +0 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog (0x1.fp+16383 - 0x1p-16445 i) == 11356.49165759582936919077408168801636572 - 0 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog (0x1.fp+16383 - 0x1p-16494 i) == 11356.49165759582936919077408168801636572 - 0 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog (0x10673dd0f2481p-51 + 0x7ef1d17cefbd2p-51 i) == 3.2047474274603604594851472963586149973093e-29 + 1.4422922682185099608731642353544207976604 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
+Test "Real part of: clog (0x1p-149 + 0x1.fp+127 i) == 88.69109041335841930424871526389807508374 + pi/2 i":
+float: 1
+ifloat: 1
+Test "Real part of: clog (0x1p-149 - 0x1.fp+127 i) == 88.69109041335841930424871526389807508374 - pi/2 i":
+float: 1
+ifloat: 1
+Test "Real part of: clog (0x1p-16445 + 0x1.fp+16383 i) == 11356.49165759582936919077408168801636572 + pi/2 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog (0x1p-16445 - 0x1.fp+16383 i) == 11356.49165759582936919077408168801636572 - pi/2 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog (0x1p-16494 + 0x1.fp+16383 i) == 11356.49165759582936919077408168801636572 + pi/2 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog (0x1p-16494 - 0x1.fp+16383 i) == 11356.49165759582936919077408168801636572 - pi/2 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog (0x2818p-15 + 0x798fp-15 i) == 1.5366822245016167178749091974664853785194e-08 + 1.2522014929038946066987318471922169174157 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog (0x298c62cb546588a7p-63 + 0x7911b1dfcc4ecdaep-63 i) == -1.1931267660846218205882675852805793644095e-36 + 1.2402109774337032400594953899784058127412 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog (0x2ede88p-23 + 0x771c3fp-23 i) == -4.4764192352906350039050902870893173560494e-13 + 1.1959106857549200806818600493552847793381 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog (0x3f96469050f650869c2p-75 + 0x6f16b2c9c8b05988335p-75 i) == -1.0509738482436128031927971874674370984602e-45 + 1.0509191467640012308402149909370784281448 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog (0x55cb6d0c83af5p-55 + 0x7fe33c0c7c4e90p-55 i) == -5.2000108498455368032511404449795741611813e-32 + 1.5288921536982513453421343495466824420259 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog (0x5b06b680ea2ccp-52 + 0xef452b965da9fp-52 i) == 8.3076914081087805757422664530653247447136e-30 + 1.2072712126771536614482822173033535043206 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog (0x659feap-24 + 0xeaf6f9p-24 i) == 3.7303493627403868207597214252239749960738e-14 + 1.1625816408046866464773042283673653469061 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog (0x6771f22c64ed551b857c128b4cp-105 + 0x1f570e7a13cc3cf2f44fd793ea1p-105 i) == -1.4281333889622737316199756373421183559948e-62 + 1.3673546561165378090903506783353927980633 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog (0x6b10b4f3520217b6p-64 + 0xe8893cbb449253a1p-64 i) == 2.4244570985709679851855191080208817099132e-37 + 1.1393074519572050614551047548718495655972 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog (0x8ecbf810c4ae6p-52 + 0xd479468b09a37p-52 i) == -9.7375017988218644730510244778042114638107e-30 + 0.9790637929494922564724108399524154766631 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog (0x9b57bp-20 + 0xcb7b4p-20 i) == -3.9563019528687610863490232935890272740908e-11 + 0.9187593477446338910857133065497364950682 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog (0xdb85c467ee2aadd5f425fe0f4b8dp-114 + 0x3e83162a0f95f1dcbf97dddf410eap-114 i) == 4.6017338806965821566734340588575402712716e-67 + 1.3547418904611758959096647942223384691728 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog (0xfd95243681c055c2632286921092p-113 + 0x1bccabcd29ca2152860ec29e34ef7p-113 i) == 6.6255694866654064502633121109394710807528e-66 + 1.0526409614996288387567810726095850312049 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog (0xfe961079616p-45 + 0x1bc37e09e6d1p-45 i) == 5.3718272201930019901317065495843842735179e-26 + 1.0503831592447830576186444373011142397404 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog (1.0 + 0x1.234566p-10 i) == 6.172834701221959432440126967147726538097e-7 + 1.111110564353742042376451655136933182201e-3 i":
+float: 1
+ifloat: 1
# clog10
Test "Imaginary part of: clog10 (-0 + inf i) == inf + pi/2*log10(e) i":
@@ -821,6 +937,53 @@ double: 1
float: 1
idouble: 1
ifloat: 1
+Test "Real part of: clog10 (-0x1.0000000123456p0 + 0x1.2345678p-1000 i) == 1.150487026509145544402795327729455391948e-10 + 1.364376353841841347485783625431355770210 i":
+double: 2
+idouble: 2
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (-0x1.0000000123456p0 + 0x1.2345678p-1000 i) == 1.150487026509145544402795327729455391948e-10 + 1.364376353841841347485783625431355770210 i":
+double: 1
+idouble: 1
+Test "Real part of: clog10 (-0x1.0000000123456p0 + 0x1.2345678p-30 i) == 1.150487028947346337782682105935961875822e-10 + 1.364376353381646356131680448946397884147 i":
+double: 2
+idouble: 2
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (-0x1.0000000123456p0 + 0x1.2345678p-30 i) == 1.150487028947346337782682105935961875822e-10 + 1.364376353381646356131680448946397884147 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (-0x1.fp+1023 + 0x1p-1074 i) == 308.2409272754311106024666378243768099991 + 1.364376353841841347485783625431355770210 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (-0x1.fp+1023 - 0x1p-1074 i) == 308.2409272754311106024666378243768099991 - 1.364376353841841347485783625431355770210 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (-0x1.fp+127 + 0x1p-149 i) == 38.51805116050395969095658815123105801479 + 1.364376353841841347485783625431355770210 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Imaginary part of: clog10 (-0x1.fp+127 - 0x1p-149 i) == 38.51805116050395969095658815123105801479 - 1.364376353841841347485783625431355770210 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Imaginary part of: clog10 (-0x1p-1074 + 0x1.fp+1023 i) == 308.2409272754311106024666378243768099991 + 0.6821881769209206737428918127156778851051 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (-0x1p-1074 - 0x1.fp+1023 i) == 308.2409272754311106024666378243768099991 - 0.6821881769209206737428918127156778851051 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (-0x1p-149 + 0x1.fp+127 i) == 38.51805116050395969095658815123105801479 + 0.6821881769209206737428918127156778851051 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (-0x1p-149 - 0x1.fp+127 i) == 38.51805116050395969095658815123105801479 - 0.6821881769209206737428918127156778851051 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (-1.0 + 0x1.234566p-20 i) == 2.556638434669064077889576526006849923281e-13 + 1.364375882602207106407956770293808181427 i":
+double: 1
+idouble: 1
Test "Real part of: clog10 (-2 - 3 i) == 0.556971676153418384603252578971164214 - 0.937554462986374708541507952140189646 i":
ildouble: 1
ldouble: 1
@@ -872,12 +1035,59 @@ double: 1
float: 1
idouble: 1
ifloat: 1
-Test "Real part of: clog10 (0.75 + 1.25 i) == 0.163679467193165171449476605077428975 + 0.447486970040493067069984724340855636 i":
+Test "Imaginary part of: clog10 (0.75 + 1.25 i) == 0.163679467193165171449476605077428975 + 0.447486970040493067069984724340855636 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog10 (0x0.fffffffffffff8p0 + 0x0.fffffffffffff8p-1000 i) == -4.821637332766435821255375046554377090472e-17 + 4.053112396770095089737411317782466262176e-302 i":
+double: 1
+idouble: 1
+Test "Real part of: clog10 (0x0.ffffffp0 + 0x0.ffffffp-100 i) == -2.588596909321764128428416045209904492216e-8 + 3.425979381266895667295625489912064603415e-31 i":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog10 (0x1.00000000000000123456789abcp0 + 0x1.23456789p-1000 i) == 4.285899851347756186652871946325962330640e-19 + 4.611541215247321502041995872887317363241e-302 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (0x1.00000000000000123456789abcp0 + 0x1.23456789p-1000 i) == 4.285899851347756186652871946325962330640e-19 + 4.611541215247321502041995872887317363241e-302 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (0x1.00000000000000123456789abcp0 + 0x1.23456789p-60 i) == 4.285899851347756188767674032946882584784e-19 + 4.285899850759344225805480528847018395861e-19 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog10 (0x1.000566p0 + 0x1.234p-10 i) == 3.604093470239754109961125085078190708674e-5 + 4.824745078422174667425851670822596859720e-4 i":
float: 1
ifloat: 1
-Test "Imaginary part of: clog10 (0.75 + 1.25 i) == 0.163679467193165171449476605077428975 + 0.447486970040493067069984724340855636 i":
+Test "Imaginary part of: clog10 (0x1.000566p0 + 0x1.234p-10 i) == 3.604093470239754109961125085078190708674e-5 + 4.824745078422174667425851670822596859720e-4 i":
+double: 1
+idouble: 1
+ildouble: 2
+ldouble: 2
+Test "Real part of: clog10 (0x1.000566p0 + 0x1.234p-100 i) == 3.577293486783822178310971763308187385546e-5 + 3.897399639875661463735636919790792140598e-31 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: clog10 (0x1.000566p0 + 0x1.234p-100 i) == 3.577293486783822178310971763308187385546e-5 + 3.897399639875661463735636919790792140598e-31 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (0x1.234566p-30 + 1.0 i) == 2.438200411482400072282924063740535840474e-19 + 6.821881764607257184291586401763604544928e-1 i":
+float: 1
+ifloat: 1
+Test "Real part of: clog10 (0x1.234566p-50 + 1.0 i) == 2.217530356103816369479108963807448194409e-31 + 6.821881769209202348667823902864283966959e-1 i":
ildouble: 1
ldouble: 1
+Test "Imaginary part of: clog10 (0x1.234566p-50 + 1.0 i) == 2.217530356103816369479108963807448194409e-31 + 6.821881769209202348667823902864283966959e-1 i":
+float: 1
+ifloat: 1
+Test "Real part of: clog10 (0x1.234566p-60 + 1.0 i) == 2.114801746467415208319767917450504756866e-37 + 6.821881769209206733143018621078368211515e-1 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (0x1.234566p-60 + 1.0 i) == 2.114801746467415208319767917450504756866e-37 + 6.821881769209206733143018621078368211515e-1 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
Test "Imaginary part of: clog10 (0x1.fffffep+127 + 0x1.fffffep+127 i) == 38.68235441693561449174780668781319348761 + pi/4*log10(e) i":
double: 1
float: 1
@@ -895,25 +1105,181 @@ ldouble: 1
Test "Real part of: clog10 (0x1.fp+16383 + 0x1p+16383 i) == 4932.112944269463028900262609694408579449 + 0.2069271710841128115912940666587802677383 i":
ildouble: 1
ldouble: 1
+Test "Real part of: clog10 (0x10673dd0f2481p-51 + 0x7ef1d17cefbd2p-51 i) == 1.3918041236396763648388478552321724382899e-29 + 0.6263795733790237053262025311642907438291 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog10 (0x1367a310575591p-54 + 0x3cfcc0a0541f60p-54 i) == 2.2081507730821788480616336165447731164865e-32 + 0.5484039935757001196548030312819898864760 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (0x1367a310575591p-54 + 0x3cfcc0a0541f60p-54 i) == 2.2081507730821788480616336165447731164865e-32 + 0.5484039935757001196548030312819898864760 i":
+double: 1
+idouble: 1
+Test "Real part of: clog10 (0x1415bcaf2105940d49a636e98ae59p-115 + 0x7e6a150adfcd1b0921d44b31f40f4p-115 i) == 1.1288799405048268615023706955013387413519e-67 + 0.6137587762850841972073301550420510507903 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (0x15cfbd1990d1ffp-53 + 0x176a3973e09a9ap-53 i) == 4.4163015461643576961232672330852798804976e-31 + 0.3564851427422832755956993418877523303529 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (0x164c74eea876p-45 + 0x16f393482f77p-45 i) == -1.3155760824064879362415202279780039150764e-26 + 0.3473590599762514228227328130640352044313 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (0x1a6p-10 + 0x3a5p-10 i) == -6.2126412844802358329771948751248003038444e-07 + 0.4977135139537443711784513409096950995985 i":
+double: 1
+idouble: 1
+Test "Real part of: clog10 (0x1df515eb171a808b9e400266p-95 + 0x7c71eb0cd4688dfe98581c77p-95 i) == -1.5221162575729652613635150540947625639689e-57 + 0.5795934880811949230121092882659698986043 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (0x1df515eb171a808b9e400266p-95 + 0x7c71eb0cd4688dfe98581c77p-95 i) == -1.5221162575729652613635150540947625639689e-57 + 0.5795934880811949230121092882659698986043 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 + 0x1.fp+1023 i) == 308.2409272754311106024666378243768099991 + 0.6821881769209206737428918127156778851051 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-1074 - 0x1.fp+1023 i) == 308.2409272754311106024666378243768099991 - 0.6821881769209206737428918127156778851051 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 + 0x1.fp+127 i) == 38.51805116050395969095658815123105801479 + 0.6821881769209206737428918127156778851051 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 (0x1p-149 - 0x1.fp+127 i) == 38.51805116050395969095658815123105801479 - 0.6821881769209206737428918127156778851051 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Imaginary part of: clog10 (0x1p-509 + 1.0 i) == 7.730698388614835910296270976605350994446e-308 + 6.821881769209206737428918127156778851051e-1 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (0x1p-510 + 1.0 i) == 1.932674597153708977574067744151337748612e-308 + 6.821881769209206737428918127156778851051e-1 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (0x1p-511 + 1.0 i) == 4.831686492884272443935169360378344371529e-309 + 6.821881769209206737428918127156778851051e-1 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (0x1p-61 + 1.0 i) == 4.084085680564517578238994467153626207224e-38 + 6.821881769209206735545466044044889962925e-1 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Imaginary part of: clog10 (0x1p-62 + 1.0 i) == 1.021021420141129394559748616788406551878e-38 + 6.821881769209206736487192085600834406988e-1 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Imaginary part of: clog10 (0x1p-63 + 1.0 i) == 2.552553550352823486399371541971016379740e-39 + 6.821881769209206736958055106378806629019e-1 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Real part of: clog10 (0x2818p-15 + 0x798fp-15 i) == 6.6737261053986614395049481326819059203910e-09 + 0.5438241985991753781478398141908629586460 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (0x2818p-15 + 0x798fp-15 i) == 6.6737261053986614395049481326819059203910e-09 + 0.5438241985991753781478398141908629586460 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog10 (0x2dd46725bp-35 + 0x7783a1284p-35 i) == 1.9312741086596516918394613098872836703188e-20 + 0.5231613813514771042838490538484014771862 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog10 (0x2ede88p-23 + 0x771c3fp-23 i) == -1.9440841725722970687903291200493082253766e-13 + 0.5193774116724956222518530053006822210323 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: clog10 (0x2ede88p-23 + 0x771c3fp-23 i) == -1.9440841725722970687903291200493082253766e-13 + 0.5193774116724956222518530053006822210323 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (0x3f96469050f650869c2p-75 + 0x6f16b2c9c8b05988335p-75 i) == -4.5643214291682663316715446865040356750881e-46 + 0.4564083863660793840592614609053162690362 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog10 (0x4447d7175p-35 + 0x6c445e00ap-35 i) == -6.4375803621988389731799033530075237868110e-21 + 0.4378257977686804492768642780897650927167 i":
+double: 1
+idouble: 1
+Test "Real part of: clog10 (0x4d4ep-15 + 0x6605p-15 i) == -7.0781945783414996953799915941870192015212e-09 + 0.4005747524909781155537088181659175147564 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog10 (0x4d9c37e2b5cb4533p-63 + 0x65c98be2385a042ep-63 i) == 2.7822833698845776001753149807484078521508e-37 + 0.3992725998539071066769046272515417679815 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog10 (0x55cb6d0c83af5p-55 + 0x7fe33c0c7c4e90p-55 i) == -2.2583360179249556400630343805573865814771e-32 + 0.6639894257763289307423302343317622430835 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (0x5b06b680ea2ccp-52 + 0xef452b965da9fp-52 i) == 3.6079845358966994996207055940336690133424e-30 + 0.5243112258263349992771652393178033846555 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog10 (0x602fd5037c4792efp-64 + 0xed3e2086dcca80b8p-64 i) == -1.0146400362652473358437501879334790111898e-37 + 0.5149047982335273098246594109614460842099 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog10 (0x6241ef0da53f539f02fad67dabp-106 + 0x3fb46641182f7efd9caa769dac0p-106 i) == 1.8804859395820231849002915747252695375405e-63 + 0.6404513901551516189871978418046651877394 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog10 (0x659feap-24 + 0xeaf6f9p-24 i) == 1.6200701438094619117335617123525612051457e-14 + 0.5049027913635038013499728086604870749732 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (0x659feap-24 + 0xeaf6f9p-24 i) == 1.6200701438094619117335617123525612051457e-14 + 0.5049027913635038013499728086604870749732 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (0x6b10b4f3520217b6p-64 + 0xe8893cbb449253a1p-64 i) == 1.0529283395205396881397407610630442563938e-37 + 0.4947949395762683446121140513971996916447 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (0x9b57bp-20 + 0xcb7b4p-20 i) == -1.7182001068739620267773842120965071561416e-11 + 0.3990121149225253562859800593935899629087 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog10 (0xdb85c467ee2aadd5f425fe0f4b8dp-114 + 0x3e83162a0f95f1dcbf97dddf410eap-114 i) == 1.9985076315737626043096596036300177494613e-67 + 0.5883569274304683249184005177865521205198 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog10 (0xf2p-10 + 0x3e3p-10 i) == 2.6921240173351112953324592659528481616879e-06 + 0.5785726025799636431142862788413361783862 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (0xf2p-10 + 0x3e3p-10 i) == 2.6921240173351112953324592659528481616879e-06 + 0.5785726025799636431142862788413361783862 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (0xfd95243681c055c2632286921092p-113 + 0x1bccabcd29ca2152860ec29e34ef7p-113 i) == 2.8774482675253468630312378575186855052697e-66 + 0.4571561610046221605554903008571429975493 i":
+ildouble: 2
+ldouble: 2
+Test "Imaginary part of: clog10 (0xfe961079616p-45 + 0x1bc37e09e6d1p-45 i) == 2.3329549194675052736016290082882121135546e-26 + 0.4561756099441139182878993697611751382976 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (1.0 + 0x1.234566p-10 i) == 2.680828048441605163181684680300513080769e-7 + 4.825491868832381486767558728169977751564e-4 i":
+double: 1
+idouble: 1
Test "Imaginary part of: clog10 (3 + inf i) == inf + pi/2*log10(e) i":
double: 1
float: 1
@@ -936,6 +1302,12 @@ idouble: 1
ifloat: 1
# cos
+Test "cos (0x1p+120) == -9.25879022854837867303861764107414946730833e-01":
+float: 1
+ifloat: 1
+Test "cos (0x1p+127) == 7.81914638714960072263910298466369236613162e-01":
+float: 1
+ifloat: 1
Test "cos (M_PI_6l * 2.0) == 0.5":
double: 1
idouble: 1
@@ -1047,8 +1419,8 @@ Test "Real part of: cpow (0.75 + 1.25 i, 0.0 + 1.0 i) == 0.331825439177608832276
float: 1
ifloat: 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":
double: 1
float: 4
@@ -1064,8 +1436,8 @@ double: 2
float: 3
idouble: 2
ifloat: 3
-ildouble: 11
-ldouble: 11
+ildouble: 2
+ldouble: 2
Test "Real part of: cpow (2 + 0 i, 10 + 0 i) == 1024.0 + 0.0 i":
ildouble: 2
ldouble: 2
@@ -1250,6 +1622,21 @@ ildouble: 1
ldouble: 1
# csqrt
+Test "Real part of: csqrt (-0x1.0000000000000000000000000001p-16382 - 0x1.0000000000000000000000000001p-16382 i) == 8.344545284118961663847948339519226074126e-2467 - 2.014551439675644900022606748976158925145e-2466 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: csqrt (-0x1.0000000000000002p-16382 - 0x1.0000000000000002p-16382 i) == 8.344545284118961664300307045791497724440e-2467 - 2.014551439675644900131815801350165472778e-2466 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: csqrt (-0x1.0000000000000002p-16382 - 0x1.0000000000000002p-16382 i) == 8.344545284118961664300307045791497724440e-2467 - 2.014551439675644900131815801350165472778e-2466 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: csqrt (-0x1.0000000000001p-1022 - 0x1.0000000000001p-1022 i) == 6.788430486774966350907249113759995429568e-155 - 1.638872094839911521020410942677082920935e-154 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: csqrt (-0x1.000002p-126 - 0x1.000002p-126 i) == 4.934094449071842328766868579214125217132e-20 - 1.191195773697904627170323731331667740087e-19 i":
+double: 1
+idouble: 1
Test "Real part of: csqrt (-2 + 3 i) == 0.89597747612983812471573375529004348 + 1.6741492280355400404480393008490519 i":
float: 1
ifloat: 1
@@ -1263,6 +1650,21 @@ 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.0000000000000000000000000001p-16382 + 0x1.0000000000000000000000000001p-16382 i) == 2.014551439675644900022606748976158925145e-2466 + 8.344545284118961663847948339519226074126e-2467 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: csqrt (0x1.0000000000000002p-16382 + 0x1.0000000000000002p-16382 i) == 2.014551439675644900131815801350165472778e-2466 + 8.344545284118961664300307045791497724440e-2467 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: csqrt (0x1.0000000000000002p-16382 + 0x1.0000000000000002p-16382 i) == 2.014551439675644900131815801350165472778e-2466 + 8.344545284118961664300307045791497724440e-2467 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: csqrt (0x1.0000000000001p-1022 + 0x1.0000000000001p-1022 i) == 1.638872094839911521020410942677082920935e-154 + 6.788430486774966350907249113759995429568e-155 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: csqrt (0x1.000002p-126 + 0x1.000002p-126 i) == 1.191195773697904627170323731331667740087e-19 + 4.934094449071842328766868579214125217132e-20 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
@@ -1347,6 +1749,98 @@ Test "Real part of: ctan (1 + 47 i) == 2.729321264492904590777293425576722354636
ildouble: 1
ldouble: 1
+# ctan_downward
+Test "Imaginary part of: ctan_downward (0x1.921fb54442d1846ap+0 + 0x1p-16445 i) == -3.986797629811710706723242948653362815645e19 + 5.793882568875674066286163141055208625180e-4912 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: ctan_downward (0x1.921fb54442d18p+0 + 0x1p-1074 i) == 1.633123935319536975596773704152891653086e16 + 1.317719414943508315995636961402669067843e-291 i":
+ildouble: 3
+ldouble: 3
+Test "Imaginary part of: ctan_downward (0x1.921fb54442d18p+0 + 0x1p-1074 i) == 1.633123935319536975596773704152891653086e16 + 1.317719414943508315995636961402669067843e-291 i":
+ildouble: 3
+ldouble: 3
+Test "Real part of: ctan_downward (0x1.921fb6p+0 + 0x1p-149 i) == -2.287733242885645987394874673945769518150e7 + 7.334008549954377778731880988481078535821e-31 i":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: ctan_downward (0x1.921fb6p+0 + 0x1p-149 i) == -2.287733242885645987394874673945769518150e7 + 7.334008549954377778731880988481078535821e-31 i":
+float: 1
+ifloat: 1
+ildouble: 2
+ldouble: 2
+
+# ctan_tonearest
+Test "Imaginary part of: ctan_tonearest (0x1.921fb54442d1846ap+0 + 0x1p-16445 i) == -3.986797629811710706723242948653362815645e19 + 5.793882568875674066286163141055208625180e-4912 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: ctan_tonearest (0x1.921fb54442d18p+0 + 0x1p-1074 i) == 1.633123935319536975596773704152891653086e16 + 1.317719414943508315995636961402669067843e-291 i":
+ildouble: 3
+ldouble: 3
+Test "Imaginary part of: ctan_tonearest (0x1.921fb54442d18p+0 + 0x1p-1074 i) == 1.633123935319536975596773704152891653086e16 + 1.317719414943508315995636961402669067843e-291 i":
+ildouble: 3
+ldouble: 3
+Test "Real part of: ctan_tonearest (0x1.921fb6p+0 + 0x1p-149 i) == -2.287733242885645987394874673945769518150e7 + 7.334008549954377778731880988481078535821e-31 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: ctan_tonearest (0x1.921fb6p+0 + 0x1p-149 i) == -2.287733242885645987394874673945769518150e7 + 7.334008549954377778731880988481078535821e-31 i":
+float: 1
+ifloat: 1
+ildouble: 2
+ldouble: 2
+
+# ctan_towardzero
+Test "Imaginary part of: ctan_towardzero (0x1.921fb54442d1846ap+0 + 0x1p-16445 i) == -3.986797629811710706723242948653362815645e19 + 5.793882568875674066286163141055208625180e-4912 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: ctan_towardzero (0x1.921fb54442d18p+0 + 0x1p-1074 i) == 1.633123935319536975596773704152891653086e16 + 1.317719414943508315995636961402669067843e-291 i":
+ildouble: 3
+ldouble: 3
+Test "Imaginary part of: ctan_towardzero (0x1.921fb54442d18p+0 + 0x1p-1074 i) == 1.633123935319536975596773704152891653086e16 + 1.317719414943508315995636961402669067843e-291 i":
+ildouble: 3
+ldouble: 3
+Test "Real part of: ctan_towardzero (0x1.921fb6p+0 + 0x1p-149 i) == -2.287733242885645987394874673945769518150e7 + 7.334008549954377778731880988481078535821e-31 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: ctan_towardzero (0x1.921fb6p+0 + 0x1p-149 i) == -2.287733242885645987394874673945769518150e7 + 7.334008549954377778731880988481078535821e-31 i":
+float: 1
+ifloat: 1
+ildouble: 2
+ldouble: 2
+
+# ctan_upward
+Test "Imaginary part of: ctan_upward (0x1.921fb54442d1846ap+0 + 0x1p-16445 i) == -3.986797629811710706723242948653362815645e19 + 5.793882568875674066286163141055208625180e-4912 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: ctan_upward (0x1.921fb54442d18p+0 + 0x1p-1074 i) == 1.633123935319536975596773704152891653086e16 + 1.317719414943508315995636961402669067843e-291 i":
+double: 1
+idouble: 1
+ildouble: 3
+ldouble: 3
+Test "Imaginary part of: ctan_upward (0x1.921fb54442d18p+0 + 0x1p-1074 i) == 1.633123935319536975596773704152891653086e16 + 1.317719414943508315995636961402669067843e-291 i":
+ildouble: 3
+ldouble: 3
+Test "Real part of: ctan_upward (0x1.921fb6p+0 + 0x1p-149 i) == -2.287733242885645987394874673945769518150e7 + 7.334008549954377778731880988481078535821e-31 i":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: ctan_upward (0x1.921fb6p+0 + 0x1p-149 i) == -2.287733242885645987394874673945769518150e7 + 7.334008549954377778731880988481078535821e-31 i":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 2
+ldouble: 2
+
# ctanh
Test "Real part of: ctanh (-2 - 3 i) == -0.965385879022133124278480269394560686 + 0.988437503832249372031403430350121098e-2 i":
double: 1
@@ -1411,6 +1905,98 @@ Test "Imaginary part of: ctanh (47 + 1 i) == 1.0 + 2.729321264492904590777293425
ildouble: 1
ldouble: 1
+# ctanh_downward
+Test "Real part of: ctanh_downward (0x1p-1074 + 0x1.921fb54442d18p+0 i) == 1.317719414943508315995636961402669067843e-291 + 1.633123935319536975596773704152891653086e16 i":
+ildouble: 3
+ldouble: 3
+Test "Imaginary part of: ctanh_downward (0x1p-1074 + 0x1.921fb54442d18p+0 i) == 1.317719414943508315995636961402669067843e-291 + 1.633123935319536975596773704152891653086e16 i":
+ildouble: 3
+ldouble: 3
+Test "Real part of: ctanh_downward (0x1p-149 + 0x1.921fb6p+0 i) == 7.334008549954377778731880988481078535821e-31 - 2.287733242885645987394874673945769518150e7 i":
+float: 1
+ifloat: 1
+ildouble: 2
+ldouble: 2
+Test "Imaginary part of: ctanh_downward (0x1p-149 + 0x1.921fb6p+0 i) == 7.334008549954377778731880988481078535821e-31 - 2.287733242885645987394874673945769518150e7 i":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: ctanh_downward (0x1p-16445 + 0x1.921fb54442d1846ap+0 i) == 5.793882568875674066286163141055208625180e-4912 - 3.986797629811710706723242948653362815645e19 i":
+ildouble: 1
+ldouble: 1
+
+# ctanh_tonearest
+Test "Real part of: ctanh_tonearest (0x1p-1074 + 0x1.921fb54442d18p+0 i) == 1.317719414943508315995636961402669067843e-291 + 1.633123935319536975596773704152891653086e16 i":
+ildouble: 3
+ldouble: 3
+Test "Imaginary part of: ctanh_tonearest (0x1p-1074 + 0x1.921fb54442d18p+0 i) == 1.317719414943508315995636961402669067843e-291 + 1.633123935319536975596773704152891653086e16 i":
+ildouble: 3
+ldouble: 3
+Test "Real part of: ctanh_tonearest (0x1p-149 + 0x1.921fb6p+0 i) == 7.334008549954377778731880988481078535821e-31 - 2.287733242885645987394874673945769518150e7 i":
+float: 1
+ifloat: 1
+ildouble: 2
+ldouble: 2
+Test "Imaginary part of: ctanh_tonearest (0x1p-149 + 0x1.921fb6p+0 i) == 7.334008549954377778731880988481078535821e-31 - 2.287733242885645987394874673945769518150e7 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: ctanh_tonearest (0x1p-16445 + 0x1.921fb54442d1846ap+0 i) == 5.793882568875674066286163141055208625180e-4912 - 3.986797629811710706723242948653362815645e19 i":
+ildouble: 1
+ldouble: 1
+
+# ctanh_towardzero
+Test "Real part of: ctanh_towardzero (0x1p-1074 + 0x1.921fb54442d18p+0 i) == 1.317719414943508315995636961402669067843e-291 + 1.633123935319536975596773704152891653086e16 i":
+ildouble: 3
+ldouble: 3
+Test "Imaginary part of: ctanh_towardzero (0x1p-1074 + 0x1.921fb54442d18p+0 i) == 1.317719414943508315995636961402669067843e-291 + 1.633123935319536975596773704152891653086e16 i":
+ildouble: 3
+ldouble: 3
+Test "Real part of: ctanh_towardzero (0x1p-149 + 0x1.921fb6p+0 i) == 7.334008549954377778731880988481078535821e-31 - 2.287733242885645987394874673945769518150e7 i":
+float: 1
+ifloat: 1
+ildouble: 2
+ldouble: 2
+Test "Imaginary part of: ctanh_towardzero (0x1p-149 + 0x1.921fb6p+0 i) == 7.334008549954377778731880988481078535821e-31 - 2.287733242885645987394874673945769518150e7 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: ctanh_towardzero (0x1p-16445 + 0x1.921fb54442d1846ap+0 i) == 5.793882568875674066286163141055208625180e-4912 - 3.986797629811710706723242948653362815645e19 i":
+ildouble: 1
+ldouble: 1
+
+# ctanh_upward
+Test "Real part of: ctanh_upward (0x1p-1074 + 0x1.921fb54442d18p+0 i) == 1.317719414943508315995636961402669067843e-291 + 1.633123935319536975596773704152891653086e16 i":
+ildouble: 3
+ldouble: 3
+Test "Imaginary part of: ctanh_upward (0x1p-1074 + 0x1.921fb54442d18p+0 i) == 1.317719414943508315995636961402669067843e-291 + 1.633123935319536975596773704152891653086e16 i":
+double: 1
+idouble: 1
+ildouble: 3
+ldouble: 3
+Test "Real part of: ctanh_upward (0x1p-149 + 0x1.921fb6p+0 i) == 7.334008549954377778731880988481078535821e-31 - 2.287733242885645987394874673945769518150e7 i":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 2
+ldouble: 2
+Test "Imaginary part of: ctanh_upward (0x1p-149 + 0x1.921fb6p+0 i) == 7.334008549954377778731880988481078535821e-31 - 2.287733242885645987394874673945769518150e7 i":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: ctanh_upward (0x1p-16445 + 0x1.921fb54442d1846ap+0 i) == 5.793882568875674066286163141055208625180e-4912 - 3.986797629811710706723242948653362815645e19 i":
+ildouble: 1
+ldouble: 1
+
# erf
Test "erf (1.25) == 0.922900128256458230136523481197281140":
double: 1
@@ -1487,6 +2073,9 @@ float: 1
ifloat: 1
# expm1
+Test "expm1 (-79.0) == -0.9999999999999999999999999999999999509391":
+ildouble: 1
+ldouble: 1
Test "expm1 (0.75) == 1.11700001661267466854536981983709561":
double: 1
idouble: 1
@@ -1811,15 +2400,38 @@ ildouble: 1
ldouble: 1
# pow
+Test "pow (0x0.fffffffffffff8p0, -0x1.23456789abcdfp62) == 9.8826311568054561811190162420900667121992e+252":
+ildouble: 1
+ldouble: 1
Test "pow (0x0.ffffffp0, -0x1p24) == 2.7182819094701610539628664526874952929416":
float: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
Test "pow (0x0.ffffffp0, 0x1p24) == 0.3678794302077803437135155590023422899744":
float: 1
ifloat: 1
Test "pow (0x1.000002p0, 0x1p24) == 7.3890552180866447284268641248075832310141":
float: 1
ifloat: 1
+Test "pow (10.0, -4930.0) == 1e-4930":
+ildouble: 1
+ldouble: 1
+Test "pow (10.0, 4929.0) == 1e4929":
+ildouble: 1
+ldouble: 1
+Test "pow (10.0, 4930.0) == 1e4930":
+ildouble: 1
+ldouble: 1
+Test "pow (10.0, 4931.0) == 1e4931":
+ildouble: 1
+ldouble: 1
+Test "pow (10.0, 4932.0) == 1e4932":
+ildouble: 1
+ldouble: 1
+Test "pow (1e4932, 0.75) == 1e3699":
+ildouble: 1
+ldouble: 1
# pow_downward
Test "pow_downward (1.5, 1.03125) == 1.519127098714743184071644334163037684948":
@@ -1898,6 +2510,12 @@ float: 1
ifloat: 1
# sincos
+Test "sincos (0x1p+120, &sin_res, &cos_res) puts -9.25879022854837867303861764107414946730833e-01 in cos_res":
+float: 1
+ifloat: 1
+Test "sincos (0x1p+127, &sin_res, &cos_res) puts 7.81914638714960072263910298466369236613162e-01 in cos_res":
+float: 1
+ifloat: 1
Test "sincos (M_PI_6l*2.0, &sin_res, &cos_res) puts 0.5 in cos_res":
double: 1
idouble: 1
@@ -2028,6 +2646,43 @@ double: 1
idouble: 1
ildouble: 1
ldouble: 1
+Test "y0 (0x1p-10) == -4.4865150767109739412411806297168793661098":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "y0 (0x1p-110) == -4.861363632869203777249475899390797503250e+1":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "y0 (0x1p-20) == -8.8992283012125827603076426611387876938160":
+float: 1
+ifloat: 1
+Test "y0 (0x1p-30) == -1.3311940304267782826037118027401817264906e+1":
+float: 1
+ifloat: 1
+ildouble: 2
+ldouble: 2
+Test "y0 (0x1p-40) == -1.7724652307320814696990854700366226762563e+1":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "y0 (0x1p-50) == -2.2137364310373846564919987139743760738155e+1":
+float: 1
+ifloat: 1
+Test "y0 (0x1p-60) == -2.6550076313426878432849115782108205929120e+1":
+ildouble: 1
+ldouble: 1
+Test "y0 (0x1p-70) == -3.0962788316479910300778244424468159753887e+1":
+double: 1
+idouble: 1
+Test "y0 (0x1p-80) == -3.5375500319532942168707373066828113573541e+1":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
Test "y0 (1.0) == 0.0882569642156769579829267660235151628":
double: 2
float: 1
@@ -2064,6 +2719,14 @@ ldouble: 1
Test "y1 (0x1.27e204p+99) == -8.881610148467797208469612080785210013461e-16":
double: 1
idouble: 1
+Test "y1 (0x1p-10) == -6.5190099301063115047395187618929589514382e+02":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "y1 (0x1p-30) == -6.8356527557643159612937462812258975438856e+08":
+ildouble: 1
+ldouble: 1
Test "y1 (1.5) == -0.412308626973911295952829820633445323":
float: 1
ifloat: 1
@@ -2371,21 +3034,27 @@ ifloat: 1
ildouble: 1
ldouble: 1
-Function: Real part of "clog10":
-double: 1
+Function: Imaginary part of "clog":
float: 1
-idouble: 1
ifloat: 1
ildouble: 1
ldouble: 1
+Function: Real part of "clog10":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+ildouble: 1
+ldouble: 1
+
Function: Imaginary part of "clog10":
double: 1
float: 1
idouble: 1
ifloat: 1
-ildouble: 1
-ldouble: 1
+ildouble: 2
+ldouble: 2
Function: "cos":
double: 2
@@ -2436,8 +3105,8 @@ double: 2
float: 4
idouble: 2
ifloat: 4
-ildouble: 11
-ldouble: 11
+ildouble: 4
+ldouble: 4
Function: Imaginary part of "cpow":
double: 2
@@ -2503,6 +3172,60 @@ idouble: 1
ildouble: 2
ldouble: 2
+Function: Real part of "ctan_downward":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 3
+ldouble: 3
+
+Function: Imaginary part of "ctan_downward":
+float: 1
+ifloat: 1
+ildouble: 3
+ldouble: 3
+
+Function: Real part of "ctan_tonearest":
+float: 1
+ifloat: 1
+ildouble: 3
+ldouble: 3
+
+Function: Imaginary part of "ctan_tonearest":
+float: 1
+ifloat: 1
+ildouble: 3
+ldouble: 3
+
+Function: Real part of "ctan_towardzero":
+float: 1
+ifloat: 1
+ildouble: 3
+ldouble: 3
+
+Function: Imaginary part of "ctan_towardzero":
+float: 1
+ifloat: 1
+ildouble: 3
+ldouble: 3
+
+Function: Real part of "ctan_upward":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 3
+ldouble: 3
+
+Function: Imaginary part of "ctan_upward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 3
+ldouble: 3
+
Function: Real part of "ctanh":
double: 1
float: 1
@@ -2519,6 +3242,60 @@ ifloat: 2
ildouble: 2
ldouble: 2
+Function: Real part of "ctanh_downward":
+float: 1
+ifloat: 1
+ildouble: 3
+ldouble: 3
+
+Function: Imaginary part of "ctanh_downward":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 3
+ldouble: 3
+
+Function: Real part of "ctanh_tonearest":
+float: 1
+ifloat: 1
+ildouble: 3
+ldouble: 3
+
+Function: Imaginary part of "ctanh_tonearest":
+float: 1
+ifloat: 1
+ildouble: 3
+ldouble: 3
+
+Function: Real part of "ctanh_towardzero":
+float: 1
+ifloat: 1
+ildouble: 3
+ldouble: 3
+
+Function: Imaginary part of "ctanh_towardzero":
+float: 1
+ifloat: 1
+ildouble: 3
+ldouble: 3
+
+Function: Real part of "ctanh_upward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 3
+ldouble: 3
+
+Function: Imaginary part of "ctanh_upward":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 3
+ldouble: 3
+
Function: "erf":
double: 1
idouble: 1
@@ -2622,6 +3399,8 @@ ldouble: 1
Function: "pow":
float: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
Function: "pow_downward":
float: 1
diff --git a/libc/ports/sysdeps/mips/mips64/n32/_itoa.h b/libc/ports/sysdeps/mips/mips64/n32/_itoa.h
new file mode 100644
index 000000000..363cdfe9a
--- /dev/null
+++ b/libc/ports/sysdeps/mips/mips64/n32/_itoa.h
@@ -0,0 +1,4 @@
+/* MIPS n32 uses 64-bit _itoa_word and _itoa is mapped to _itoa_word. */
+#define _ITOA_NEEDED 0
+#define _ITOA_WORD_TYPE unsigned long long int
+#include_next <_itoa.h>
diff --git a/libc/ports/sysdeps/mips/sotruss-lib.c b/libc/ports/sysdeps/mips/sotruss-lib.c
new file mode 100644
index 000000000..6706be949
--- /dev/null
+++ b/libc/ports/sysdeps/mips/sotruss-lib.c
@@ -0,0 +1,117 @@
+/* Override generic sotruss-lib.c to define actual functions for MIPS.
+ 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/>. */
+
+#define HAVE_ARCH_PLTENTER
+#define HAVE_ARCH_PLTEXIT
+
+#include <elf/sotruss-lib.c>
+
+#if _MIPS_SIM == _ABIO32
+
+ElfW(Addr)
+la_mips_o32_gnu_pltenter (ElfW(Sym) *sym __attribute__ ((unused)),
+ unsigned int ndx __attribute__ ((unused)),
+ uintptr_t *refcook, uintptr_t *defcook,
+ La_mips_32_regs *regs, unsigned int *flags,
+ const char *symname, long int *framesizep)
+{
+ print_enter (refcook, defcook, symname,
+ regs->lr_reg[0], regs->lr_reg[1], regs->lr_reg[2],
+ *flags);
+
+ /* No need to copy anything, we will not need the parameters in any case. */
+ *framesizep = 0;
+
+ return sym->st_value;
+}
+
+unsigned int
+la_mips_o32_gnu_pltexit (ElfW(Sym) *sym, unsigned int ndx, uintptr_t *refcook,
+ uintptr_t *defcook,
+ const struct La_mips_32_regs *inregs,
+ struct La_mips_32_retval *outregs,
+ const char *symname)
+{
+ print_exit (refcook, defcook, symname, outregs->lrv_v0);
+
+ return 0;
+}
+
+#elif _MIPS_SIM == _ABIN32
+
+ElfW(Addr)
+la_mips_n32_gnu_pltenter (ElfW(Sym) *sym __attribute__ ((unused)),
+ unsigned int ndx __attribute__ ((unused)),
+ uintptr_t *refcook, uintptr_t *defcook,
+ La_mips_64_regs *regs, unsigned int *flags,
+ const char *symname, long int *framesizep)
+{
+ print_enter (refcook, defcook, symname,
+ regs->lr_reg[0], regs->lr_reg[1], regs->lr_reg[2],
+ *flags);
+
+ /* No need to copy anything, we will not need the parameters in any case. */
+ *framesizep = 0;
+
+ return sym->st_value;
+}
+
+unsigned int
+la_mips_n32_gnu_pltexit (ElfW(Sym) *sym, unsigned int ndx, uintptr_t *refcook,
+ uintptr_t *defcook,
+ const struct La_mips_64_regs *inregs,
+ struct La_mips_64_retval *outregs,
+ const char *symname)
+{
+ print_exit (refcook, defcook, symname, outregs->lrv_v0);
+
+ return 0;
+}
+
+#else
+
+ElfW(Addr)
+la_mips_n64_gnu_pltenter (ElfW(Sym) *sym __attribute__ ((unused)),
+ unsigned int ndx __attribute__ ((unused)),
+ uintptr_t *refcook, uintptr_t *defcook,
+ La_mips_64_regs *regs, unsigned int *flags,
+ const char *symname, long int *framesizep)
+{
+ print_enter (refcook, defcook, symname,
+ regs->lr_reg[0], regs->lr_reg[1], regs->lr_reg[2],
+ *flags);
+
+ /* No need to copy anything, we will not need the parameters in any case. */
+ *framesizep = 0;
+
+ return sym->st_value;
+}
+
+unsigned int
+la_mips_n64_gnu_pltexit (ElfW(Sym) *sym, unsigned int ndx, uintptr_t *refcook,
+ uintptr_t *defcook,
+ const struct La_mips_64_regs *inregs,
+ struct La_mips_64_retval *outregs,
+ const char *symname)
+{
+ print_exit (refcook, defcook, symname, outregs->lrv_v0);
+
+ return 0;
+}
+
+#endif
diff --git a/libc/ports/sysdeps/powerpc/nofpu/libm-test-ulps b/libc/ports/sysdeps/powerpc/nofpu/libm-test-ulps
index 651692a42..652cad322 100644
--- a/libc/ports/sysdeps/powerpc/nofpu/libm-test-ulps
+++ b/libc/ports/sysdeps/powerpc/nofpu/libm-test-ulps
@@ -136,6 +136,9 @@ ldouble: 1
Test "atan2 (-0.75, -1.0) == -2.49809154479650885165983415456218025":
float: 1
ifloat: 1
+Test "atan2 (-max_value, -min_value) == -pi/2":
+float: 1
+ifloat: 1
Test "atan2 (0.75, -1.0) == 2.49809154479650885165983415456218025":
float: 1
ifloat: 1
@@ -676,15 +679,63 @@ float: 2
ifloat: 2
# clog
+Test "Real part of: clog (-0x1.0000000123456p0 + 0x1.2345678p-1000 i) == 2.649094276923003995420209214900915462737e-10 + 3.141592653589793238462643383279502884197 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog (-0x1.0000000123456p0 + 0x1.2345678p-30 i) == 2.649094282537168795982991778475646793277e-10 + 3.141592652530155111500161671113150737892 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog (-0x1.234566p-40 - 1.0 i) == 5.354083939753840089583620652120903838944e-25 - 1.570796326795931422008642456283782656359 i":
+float: 1
+ifloat: 1
+Test "Real part of: clog (-0x1.fp+127 + 0x1p-149 i) == 88.69109041335841930424871526389807508374 + pi i":
+float: 1
+ifloat: 1
+Test "Real part of: clog (-0x1.fp+127 - 0x1p-149 i) == 88.69109041335841930424871526389807508374 - pi i":
+float: 1
+ifloat: 1
+Test "Real part of: clog (-0x1p-149 + 0x1.fp+127 i) == 88.69109041335841930424871526389807508374 + pi/2 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: clog (-0x1p-149 + 0x1.fp+127 i) == 88.69109041335841930424871526389807508374 + pi/2 i":
+float: 1
+ifloat: 1
+Test "Real part of: clog (-0x1p-149 - 0x1.fp+127 i) == 88.69109041335841930424871526389807508374 - pi/2 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: clog (-0x1p-149 - 0x1.fp+127 i) == 88.69109041335841930424871526389807508374 - pi/2 i":
+float: 1
+ifloat: 1
Test "Imaginary part of: clog (-2 - 3 i) == 1.2824746787307683680267437207826593 - 2.1587989303424641704769327722648368 i":
ildouble: 1
ldouble: 1
-Test "Real part of: clog (0.75 + 1.25 i) == 0.376885901188190075998919126749298416 + 1.03037682652431246378774332703115153 i":
+Test "Imaginary part of: clog (0.75 + 1.25 i) == 0.376885901188190075998919126749298416 + 1.03037682652431246378774332703115153 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog (0x0.ffffffp0 + 0x0.ffffffp-100 i) == -5.960464655174753498633255797994360530379e-8 + 7.888609052210118054117285652827862296732e-31 i":
float: 1
ifloat: 1
+Test "Real part of: clog (0x1.000566p0 + 0x1.234p-10 i) == 8.298731898331237038231468223024422855654e-5 + 1.110938609507128729312743251313024793990e-3 i":
+float: 1
+ifloat: 1
+Test "Real part of: clog (0x1.fp+127 + 0x1p-149 i) == 88.69109041335841930424871526389807508374 + +0 i":
+float: 1
+ifloat: 1
+Test "Real part of: clog (0x1.fp+127 - 0x1p-149 i) == 88.69109041335841930424871526389807508374 - 0 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: clog (0x11682p-23 + 0x7ffed1p-23 i) == 1.1723955140027907954461000991619077811832e-12 + 1.5622968405332756349813737986164832897108 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog (0x13836d58a13448d750b4b9p-85 + 0x195ca7bc3ab4f9161edbe6p-85 i) == 2.8398125044729578740243199963484494962411e-50 + 0.9149964976334130461795060758257083099706 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog (0x155f8afc4c48685bf63610p-85 + 0x17d0cf2652cdbeb1294e19p-85 i) == -4.7775669192897997174762089350332738583822e-50 + 0.8393953487996880419413728440067635213372 i":
ildouble: 2
ldouble: 2
-Test "Imaginary part of: clog (0.75 + 1.25 i) == 0.376885901188190075998919126749298416 + 1.03037682652431246378774332703115153 i":
+Test "Imaginary part of: clog (0x15cfbd1990d1ffp-53 + 0x176a3973e09a9ap-53 i) == 1.0168910106364605304135563536838075568606e-30 + 0.8208373755522359859870890246475340086663 i":
ildouble: 1
ldouble: 1
Test "Real part of: clog (0x1p-1074 + 0x1p-1074 i) == -744.0934983311012896593986823853525458290 + pi/4 i":
@@ -693,6 +744,33 @@ idouble: 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 + 0x1.fp+127 i) == 88.69109041335841930424871526389807508374 + pi/2 i":
+float: 1
+ifloat: 1
+Test "Real part of: clog (0x1p-149 - 0x1.fp+127 i) == 88.69109041335841930424871526389807508374 - pi/2 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: clog (0x2818p-15 + 0x798fp-15 i) == 1.5366822245016167178749091974664853785194e-08 + 1.2522014929038946066987318471922169174157 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: clog (0x4d9c37e2b5cb4533p-63 + 0x65c98be2385a042ep-63 i) == 6.4064442119814669184296141278612389400075e-37 + 0.9193591364645830864185131402313014890145 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog (0x6241ef0da53f539f02fad67dabp-106 + 0x3fb46641182f7efd9caa769dac0p-106 i) == 4.3299788920664682288477984749202524623248e-63 + 1.4746938237585656250866370987773473745867 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog (0xa1f2c1p-24 + 0xc643aep-24 i) == -1.0480505352462576151523512837107080269981e-13 + 0.8858771987699967480545613322309315260313 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog (0xa4722f19346cp-51 + 0x7f9631c5e7f07p-51 i) == -6.2122796286154679676173624516405339768606e-30 + 1.4904138780720095276446375492434049214172 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog (0xf2p-10 + 0x3e3p-10 i) == 6.1988446308070710970664736815277450078106e-06 + 1.3322126499153926210226335249558203898460 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog (1.0 + 0x1.234566p-10 i) == 6.172834701221959432440126967147726538097e-7 + 1.111110564353742042376451655136933182201e-3 i":
+float: 1
+ifloat: 1
# clog10
Test "Imaginary part of: clog10 (-0 + inf i) == inf + pi/2*log10(e) i":
@@ -705,6 +783,51 @@ double: 1
float: 1
idouble: 1
ifloat: 1
+Test "Real part of: clog10 (-0x1.0000000123456p0 + 0x1.2345678p-1000 i) == 1.150487026509145544402795327729455391948e-10 + 1.364376353841841347485783625431355770210 i":
+double: 2
+idouble: 2
+ildouble: 2
+ldouble: 2
+Test "Imaginary part of: clog10 (-0x1.0000000123456p0 + 0x1.2345678p-1000 i) == 1.150487026509145544402795327729455391948e-10 + 1.364376353841841347485783625431355770210 i":
+double: 1
+idouble: 1
+Test "Real part of: clog10 (-0x1.0000000123456p0 + 0x1.2345678p-30 i) == 1.150487028947346337782682105935961875822e-10 + 1.364376353381646356131680448946397884147 i":
+double: 2
+idouble: 2
+Test "Imaginary part of: clog10 (-0x1.0000000123456p0 + 0x1.2345678p-30 i) == 1.150487028947346337782682105935961875822e-10 + 1.364376353381646356131680448946397884147 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (-0x1.fp+1023 + 0x1p-1074 i) == 308.2409272754311106024666378243768099991 + 1.364376353841841347485783625431355770210 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (-0x1.fp+1023 - 0x1p-1074 i) == 308.2409272754311106024666378243768099991 - 1.364376353841841347485783625431355770210 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (-0x1.fp+127 + 0x1p-149 i) == 38.51805116050395969095658815123105801479 + 1.364376353841841347485783625431355770210 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Imaginary part of: clog10 (-0x1.fp+127 - 0x1p-149 i) == 38.51805116050395969095658815123105801479 - 1.364376353841841347485783625431355770210 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Imaginary part of: clog10 (-0x1p-1074 + 0x1.fp+1023 i) == 308.2409272754311106024666378243768099991 + 0.6821881769209206737428918127156778851051 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (-0x1p-1074 - 0x1.fp+1023 i) == 308.2409272754311106024666378243768099991 - 0.6821881769209206737428918127156778851051 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (-0x1p-149 + 0x1.fp+127 i) == 38.51805116050395969095658815123105801479 + 0.6821881769209206737428918127156778851051 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (-0x1p-149 - 0x1.fp+127 i) == 38.51805116050395969095658815123105801479 - 0.6821881769209206737428918127156778851051 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (-1.0 + 0x1.234566p-20 i) == 2.556638434669064077889576526006849923281e-13 + 1.364375882602207106407956770293808181427 i":
+double: 1
+idouble: 1
Test "Imaginary part of: clog10 (-2 - 3 i) == 0.556971676153418384603252578971164214 - 0.937554462986374708541507952140189646 i":
double: 1
idouble: 1
@@ -753,11 +876,38 @@ double: 1
float: 1
idouble: 1
ifloat: 1
-Test "Real part of: clog10 (0.75 + 1.25 i) == 0.163679467193165171449476605077428975 + 0.447486970040493067069984724340855636 i":
+Test "Real part of: clog10 (0x0.fffffffffffff8p0 + 0x0.fffffffffffff8p-1000 i) == -4.821637332766435821255375046554377090472e-17 + 4.053112396770095089737411317782466262176e-302 i":
+double: 1
+idouble: 1
+Test "Real part of: clog10 (0x0.ffffffp0 + 0x0.ffffffp-100 i) == -2.588596909321764128428416045209904492216e-8 + 3.425979381266895667295625489912064603415e-31 i":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+Test "Real part of: clog10 (0x1.000566p0 + 0x1.234p-10 i) == 3.604093470239754109961125085078190708674e-5 + 4.824745078422174667425851670822596859720e-4 i":
float: 1
ifloat: 1
-ildouble: 3
-ldouble: 3
+Test "Imaginary part of: clog10 (0x1.000566p0 + 0x1.234p-10 i) == 3.604093470239754109961125085078190708674e-5 + 4.824745078422174667425851670822596859720e-4 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog10 (0x1.000566p0 + 0x1.234p-100 i) == 3.577293486783822178310971763308187385546e-5 + 3.897399639875661463735636919790792140598e-31 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: clog10 (0x1.234566p-30 + 1.0 i) == 2.438200411482400072282924063740535840474e-19 + 6.821881764607257184291586401763604544928e-1 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: clog10 (0x1.234566p-50 + 1.0 i) == 2.217530356103816369479108963807448194409e-31 + 6.821881769209202348667823902864283966959e-1 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: clog10 (0x1.234566p-60 + 1.0 i) == 2.114801746467415208319767917450504756866e-37 + 6.821881769209206733143018621078368211515e-1 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+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
@@ -769,25 +919,154 @@ 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 (0x10673dd0f2481p-51 + 0x7ef1d17cefbd2p-51 i) == 1.3918041236396763648388478552321724382899e-29 + 0.6263795733790237053262025311642907438291 i":
+double: 1
+idouble: 1
+Test "Real part of: clog10 (0x1367a310575591p-54 + 0x3cfcc0a0541f60p-54 i) == 2.2081507730821788480616336165447731164865e-32 + 0.5484039935757001196548030312819898864760 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (0x1367a310575591p-54 + 0x3cfcc0a0541f60p-54 i) == 2.2081507730821788480616336165447731164865e-32 + 0.5484039935757001196548030312819898864760 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (0x13836d58a13448d750b4b9p-85 + 0x195ca7bc3ab4f9161edbe6p-85 i) == 1.2333149003324592532859843519619084433953e-50 + 0.3973779298829931059309198145608711073016 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (0x155f8afc4c48685bf63610p-85 + 0x17d0cf2652cdbeb1294e19p-85 i) == -2.0748709499710785084693619097712106753591e-50 + 0.3645447681189598740620098186365764884771 i":
+ildouble: 2
+ldouble: 2
+Test "Real part of: clog10 (0x15d8ab6ed05ca514086ac3a1e84p-105 + 0x1761e480aa094c0b10b34b09ce9p-105 i) == 4.3548095442952115860848857519953610343042e-63 + 0.3558376234889641500775150477035448866763 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (0x164c74eea876p-45 + 0x16f393482f77p-45 i) == -1.3155760824064879362415202279780039150764e-26 + 0.3473590599762514228227328130640352044313 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (0x1a6p-10 + 0x3a5p-10 i) == -6.2126412844802358329771948751248003038444e-07 + 0.4977135139537443711784513409096950995985 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (0x1df515eb171a808b9e400266p-95 + 0x7c71eb0cd4688dfe98581c77p-95 i) == -1.5221162575729652613635150540947625639689e-57 + 0.5795934880811949230121092882659698986043 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 + 0x1.fp+1023 i) == 308.2409272754311106024666378243768099991 + 0.6821881769209206737428918127156778851051 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-1074 - 0x1.fp+1023 i) == 308.2409272754311106024666378243768099991 - 0.6821881769209206737428918127156778851051 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 + 0x1.fp+127 i) == 38.51805116050395969095658815123105801479 + 0.6821881769209206737428918127156778851051 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 (0x1p-149 - 0x1.fp+127 i) == 38.51805116050395969095658815123105801479 - 0.6821881769209206737428918127156778851051 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Imaginary part of: clog10 (0x1p-509 + 1.0 i) == 7.730698388614835910296270976605350994446e-308 + 6.821881769209206737428918127156778851051e-1 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (0x1p-510 + 1.0 i) == 1.932674597153708977574067744151337748612e-308 + 6.821881769209206737428918127156778851051e-1 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (0x1p-511 + 1.0 i) == 4.831686492884272443935169360378344371529e-309 + 6.821881769209206737428918127156778851051e-1 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (0x1p-61 + 1.0 i) == 4.084085680564517578238994467153626207224e-38 + 6.821881769209206735545466044044889962925e-1 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (0x1p-62 + 1.0 i) == 1.021021420141129394559748616788406551878e-38 + 6.821881769209206736487192085600834406988e-1 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Imaginary part of: clog10 (0x1p-63 + 1.0 i) == 2.552553550352823486399371541971016379740e-39 + 6.821881769209206736958055106378806629019e-1 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Real part of: clog10 (0x2818p-15 + 0x798fp-15 i) == 6.6737261053986614395049481326819059203910e-09 + 0.5438241985991753781478398141908629586460 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (0x2818p-15 + 0x798fp-15 i) == 6.6737261053986614395049481326819059203910e-09 + 0.5438241985991753781478398141908629586460 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: clog10 (0x298c62cb546588a7p-63 + 0x7911b1dfcc4ecdaep-63 i) == -5.1816837072162316773907242302011632570857e-37 + 0.5386167838952956925896424154370364458140 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog10 (0x2dd46725bp-35 + 0x7783a1284p-35 i) == 1.9312741086596516918394613098872836703188e-20 + 0.5231613813514771042838490538484014771862 i":
+double: 1
+idouble: 1
+Test "Real part of: clog10 (0x2ede88p-23 + 0x771c3fp-23 i) == -1.9440841725722970687903291200493082253766e-13 + 0.5193774116724956222518530053006822210323 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: clog10 (0x2ede88p-23 + 0x771c3fp-23 i) == -1.9440841725722970687903291200493082253766e-13 + 0.5193774116724956222518530053006822210323 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog10 (0x4447d7175p-35 + 0x6c445e00ap-35 i) == -6.4375803621988389731799033530075237868110e-21 + 0.4378257977686804492768642780897650927167 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (0x4d4ep-15 + 0x6605p-15 i) == -7.0781945783414996953799915941870192015212e-09 + 0.4005747524909781155537088181659175147564 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (0x5b06b680ea2ccp-52 + 0xef452b965da9fp-52 i) == 3.6079845358966994996207055940336690133424e-30 + 0.5243112258263349992771652393178033846555 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (0x81b7efa81fc35ad1p-65 + 0x1ef4b835f1c79d812p-65 i) == -4.3074341162203896332989394770760901408798e-39 + 0.5709443672155660428417571212549720987784 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (0x9b57bp-20 + 0xcb7b4p-20 i) == -1.7182001068739620267773842120965071561416e-11 + 0.3990121149225253562859800593935899629087 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (0xe33f66c9542ca25cc43c867p-95 + 0x7f35a68ebd3704a43c465864p-95 i) == 1.7850272475173865337808494725293124613817e-56 + 0.6338990862456906754888183278564382516852 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog10 (0xf2p-10 + 0x3e3p-10 i) == 2.6921240173351112953324592659528481616879e-06 + 0.5785726025799636431142862788413361783862 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (0xf2p-10 + 0x3e3p-10 i) == 2.6921240173351112953324592659528481616879e-06 + 0.5785726025799636431142862788413361783862 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (0xfe961079616p-45 + 0x1bc37e09e6d1p-45 i) == 2.3329549194675052736016290082882121135546e-26 + 0.4561756099441139182878993697611751382976 i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (1.0 + 0x1.234566p-10 i) == 2.680828048441605163181684680300513080769e-7 + 4.825491868832381486767558728169977751564e-4 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
Test "Imaginary part of: clog10 (3 + inf i) == inf + pi/2*log10(e) i":
double: 1
float: 1
@@ -810,6 +1089,12 @@ idouble: 1
ifloat: 1
# cos
+Test "cos (0x1p+120) == -9.25879022854837867303861764107414946730833e-01":
+float: 1
+ifloat: 1
+Test "cos (0x1p+127) == 7.81914638714960072263910298466369236613162e-01":
+float: 1
+ifloat: 1
Test "cos (M_PI_6l * 2.0) == 0.5":
double: 1
idouble: 1
@@ -965,19 +1250,13 @@ float: 1
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":
double: 1
float: 4
idouble: 1
ifloat: 4
-Test "Imaginary part of: cpow (0.75 + 1.25 i, 0.75 + 1.25 i) == 0.117506293914473555420279832210420483 + 0.346552747708338676483025352060418001 i":
-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: 2
ldouble: 2
@@ -986,8 +1265,8 @@ double: 2
float: 3
idouble: 2
ifloat: 3
-ildouble: 1
-ldouble: 1
+ildouble: 4
+ldouble: 4
Test "Real part of: cpow (2 + 0 i, 10 + 0 i) == 1024.0 + 0.0 i":
ildouble: 1
ldouble: 1
@@ -1099,12 +1378,18 @@ ildouble: 2
ldouble: 2
# csqrt
+Test "Real part of: csqrt (-0x1.000002p-126 - 0x1.000002p-126 i) == 4.934094449071842328766868579214125217132e-20 - 1.191195773697904627170323731331667740087e-19 i":
+double: 1
+idouble: 1
Test "Real part of: csqrt (-2 + 3 i) == 0.89597747612983812471573375529004348 + 1.6741492280355400404480393008490519 i":
float: 1
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.000002p-126 + 0x1.000002p-126 i) == 1.191195773697904627170323731331667740087e-19 + 4.934094449071842328766868579214125217132e-20 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
@@ -1119,6 +1404,9 @@ double: 1
idouble: 1
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
# ctan
Test "Real part of: ctan (-2 - 3 i) == 0.376402564150424829275122113032269084e-2 - 1.00323862735360980144635859782192726 i":
@@ -1129,32 +1417,111 @@ ldouble: 1
Test "Imaginary 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 (0.75 + 1.25 i) == 0.160807785916206426725166058173438663 + 0.975363285031235646193581759755216379 i":
double: 1
idouble: 1
-ildouble: 1
-ldouble: 1
Test "Real part of: ctan (0x1p1023 + 1 i) == -0.2254627924997545057926782581695274244229 + 0.8786063118883068695462540226219865087189 i":
double: 1
idouble: 1
+Test "Imaginary part of: ctan (0x1p1023 + 1 i) == -0.2254627924997545057926782581695274244229 + 0.8786063118883068695462540226219865087189 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: ctan (0x1p127 + 1 i) == 0.2446359391192790896381501310437708987204 + 0.9101334047676183761532873794426475906201 i":
+ildouble: 1
+ldouble: 1
Test "Imaginary part of: ctan (0x1p127 + 1 i) == 0.2446359391192790896381501310437708987204 + 0.9101334047676183761532873794426475906201 i":
double: 1
idouble: 1
+ildouble: 2
+ldouble: 2
Test "Real part of: ctan (0x3.243f6cp-1 + 0 i) == -2.287733242885645987394874673945769518150e7 + 0.0 i":
float: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
Test "Real part of: ctan (1 + 47 i) == 2.729321264492904590777293425576722354636e-41 + 1.0 i":
ildouble: 2
ldouble: 2
+# ctan_downward
+Test "Real part of: ctan_downward (0x1.921fb54442d18p+0 + 0x1p-1074 i) == 1.633123935319536975596773704152891653086e16 + 1.317719414943508315995636961402669067843e-291 i":
+ildouble: 3
+ldouble: 3
+Test "Real part of: ctan_downward (0x1.921fb6p+0 + 0x1p-149 i) == -2.287733242885645987394874673945769518150e7 + 7.334008549954377778731880988481078535821e-31 i":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 3
+ldouble: 3
+Test "Imaginary part of: ctan_downward (0x1.921fb6p+0 + 0x1p-149 i) == -2.287733242885645987394874673945769518150e7 + 7.334008549954377778731880988481078535821e-31 i":
+float: 1
+ifloat: 1
+ildouble: 10
+ldouble: 10
+
+# ctan_tonearest
+Test "Real part of: ctan_tonearest (0x1.921fb6p+0 + 0x1p-149 i) == -2.287733242885645987394874673945769518150e7 + 7.334008549954377778731880988481078535821e-31 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: ctan_tonearest (0x1.921fb6p+0 + 0x1p-149 i) == -2.287733242885645987394874673945769518150e7 + 7.334008549954377778731880988481078535821e-31 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+# ctan_towardzero
+Test "Real part of: ctan_towardzero (0x1.921fb54442d18p+0 + 0x1p-1074 i) == 1.633123935319536975596773704152891653086e16 + 1.317719414943508315995636961402669067843e-291 i":
+ildouble: 4
+ldouble: 4
+Test "Imaginary part of: ctan_towardzero (0x1.921fb54442d18p+0 + 0x1p-1074 i) == 1.633123935319536975596773704152891653086e16 + 1.317719414943508315995636961402669067843e-291 i":
+ildouble: 13
+ldouble: 13
+Test "Real part of: ctan_towardzero (0x1.921fb6p+0 + 0x1p-149 i) == -2.287733242885645987394874673945769518150e7 + 7.334008549954377778731880988481078535821e-31 i":
+float: 1
+ifloat: 1
+ildouble: 2
+ldouble: 2
+Test "Imaginary part of: ctan_towardzero (0x1.921fb6p+0 + 0x1p-149 i) == -2.287733242885645987394874673945769518150e7 + 7.334008549954377778731880988481078535821e-31 i":
+float: 1
+ifloat: 1
+ildouble: 10
+ldouble: 10
+
+# ctan_upward
+Test "Real part of: ctan_upward (0x1.921fb54442d18p+0 + 0x1p-1074 i) == 1.633123935319536975596773704152891653086e16 + 1.317719414943508315995636961402669067843e-291 i":
+double: 1
+idouble: 1
+ildouble: 6
+ldouble: 6
+Test "Imaginary part of: ctan_upward (0x1.921fb54442d18p+0 + 0x1p-1074 i) == 1.633123935319536975596773704152891653086e16 + 1.317719414943508315995636961402669067843e-291 i":
+ildouble: 10
+ldouble: 10
+Test "Real part of: ctan_upward (0x1.921fb6p+0 + 0x1p-149 i) == -2.287733242885645987394874673945769518150e7 + 7.334008549954377778731880988481078535821e-31 i":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 3
+ldouble: 3
+Test "Imaginary part of: ctan_upward (0x1.921fb6p+0 + 0x1p-149 i) == -2.287733242885645987394874673945769518150e7 + 7.334008549954377778731880988481078535821e-31 i":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 1
+ldouble: 1
+
# ctanh
Test "Real part of: ctanh (-2 - 3 i) == -0.965385879022133124278480269394560686 + 0.988437503832249372031403430350121098e-2 i":
double: 1
float: 1
idouble: 1
ifloat: 1
+ildouble: 2
+ldouble: 2
Test "Imaginary part of: ctanh (-2 - 3 i) == -0.965385879022133124278480269394560686 + 0.988437503832249372031403430350121098e-2 i":
double: 1
float: 1
@@ -1163,6 +1530,8 @@ ifloat: 1
Test "Imaginary part of: ctanh (0 + 0x3.243f6cp-1 i) == 0.0 - 2.287733242885645987394874673945769518150e7 i":
float: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
Test "Imaginary part of: ctanh (0 + pi/4 i) == 0.0 + 1.0 i":
double: 1
float: 1
@@ -1173,23 +1542,102 @@ double: 1
float: 1
idouble: 1
ifloat: 1
-ildouble: 1
-ldouble: 1
+ildouble: 2
+ldouble: 2
Test "Imaginary part of: ctanh (0.75 + 1.25 i) == 1.37260757053378320258048606571226857 + 0.385795952609750664177596760720790220 i":
float: 2
ifloat: 2
ildouble: 2
ldouble: 2
+Test "Real part of: ctanh (1 + 0x1p1023 i) == 0.8786063118883068695462540226219865087189 - 0.2254627924997545057926782581695274244229 i":
+ildouble: 1
+ldouble: 1
Test "Imaginary part of: ctanh (1 + 0x1p1023 i) == 0.8786063118883068695462540226219865087189 - 0.2254627924997545057926782581695274244229 i":
double: 1
idouble: 1
Test "Real part of: ctanh (1 + 0x1p127 i) == 0.9101334047676183761532873794426475906201 + 0.2446359391192790896381501310437708987204 i":
double: 1
idouble: 1
+ildouble: 2
+ldouble: 2
+Test "Imaginary part of: ctanh (1 + 0x1p127 i) == 0.9101334047676183761532873794426475906201 + 0.2446359391192790896381501310437708987204 i":
+ildouble: 1
+ldouble: 1
Test "Imaginary part of: ctanh (47 + 1 i) == 1.0 + 2.729321264492904590777293425576722354636e-41 i":
ildouble: 2
ldouble: 2
+# ctanh_downward
+Test "Imaginary part of: ctanh_downward (0x1p-1074 + 0x1.921fb54442d18p+0 i) == 1.317719414943508315995636961402669067843e-291 + 1.633123935319536975596773704152891653086e16 i":
+ildouble: 3
+ldouble: 3
+Test "Real part of: ctanh_downward (0x1p-149 + 0x1.921fb6p+0 i) == 7.334008549954377778731880988481078535821e-31 - 2.287733242885645987394874673945769518150e7 i":
+float: 1
+ifloat: 1
+ildouble: 10
+ldouble: 10
+Test "Imaginary part of: ctanh_downward (0x1p-149 + 0x1.921fb6p+0 i) == 7.334008549954377778731880988481078535821e-31 - 2.287733242885645987394874673945769518150e7 i":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 3
+ldouble: 3
+
+# ctanh_tonearest
+Test "Real part of: ctanh_tonearest (0x1p-149 + 0x1.921fb6p+0 i) == 7.334008549954377778731880988481078535821e-31 - 2.287733242885645987394874673945769518150e7 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: ctanh_tonearest (0x1p-149 + 0x1.921fb6p+0 i) == 7.334008549954377778731880988481078535821e-31 - 2.287733242885645987394874673945769518150e7 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+# ctanh_towardzero
+Test "Real part of: ctanh_towardzero (0x1p-1074 + 0x1.921fb54442d18p+0 i) == 1.317719414943508315995636961402669067843e-291 + 1.633123935319536975596773704152891653086e16 i":
+ildouble: 13
+ldouble: 13
+Test "Imaginary part of: ctanh_towardzero (0x1p-1074 + 0x1.921fb54442d18p+0 i) == 1.317719414943508315995636961402669067843e-291 + 1.633123935319536975596773704152891653086e16 i":
+ildouble: 4
+ldouble: 4
+Test "Real part of: ctanh_towardzero (0x1p-149 + 0x1.921fb6p+0 i) == 7.334008549954377778731880988481078535821e-31 - 2.287733242885645987394874673945769518150e7 i":
+float: 1
+ifloat: 1
+ildouble: 10
+ldouble: 10
+Test "Imaginary part of: ctanh_towardzero (0x1p-149 + 0x1.921fb6p+0 i) == 7.334008549954377778731880988481078535821e-31 - 2.287733242885645987394874673945769518150e7 i":
+float: 1
+ifloat: 1
+ildouble: 2
+ldouble: 2
+
+# ctanh_upward
+Test "Real part of: ctanh_upward (0x1p-1074 + 0x1.921fb54442d18p+0 i) == 1.317719414943508315995636961402669067843e-291 + 1.633123935319536975596773704152891653086e16 i":
+ildouble: 10
+ldouble: 10
+Test "Imaginary part of: ctanh_upward (0x1p-1074 + 0x1.921fb54442d18p+0 i) == 1.317719414943508315995636961402669067843e-291 + 1.633123935319536975596773704152891653086e16 i":
+double: 1
+idouble: 1
+ildouble: 6
+ldouble: 6
+Test "Real part of: ctanh_upward (0x1p-149 + 0x1.921fb6p+0 i) == 7.334008549954377778731880988481078535821e-31 - 2.287733242885645987394874673945769518150e7 i":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: ctanh_upward (0x1p-149 + 0x1.921fb6p+0 i) == 7.334008549954377778731880988481078535821e-31 - 2.287733242885645987394874673945769518150e7 i":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 3
+ldouble: 3
+
# erf
Test "erf (1.25) == 0.922900128256458230136523481197281140":
double: 1
@@ -1666,6 +2114,12 @@ float: 1
ifloat: 1
# sincos
+Test "sincos (0x1p+120, &sin_res, &cos_res) puts -9.25879022854837867303861764107414946730833e-01 in cos_res":
+float: 1
+ifloat: 1
+Test "sincos (0x1p+127, &sin_res, &cos_res) puts 7.81914638714960072263910298466369236613162e-01 in cos_res":
+float: 1
+ifloat: 1
Test "sincos (M_PI_6l*2.0, &sin_res, &cos_res) puts 0.5 in cos_res":
double: 1
idouble: 1
@@ -1722,6 +2176,60 @@ ildouble: 1
ldouble: 1
# tan
+Test "tan (-0xc.908p-4) == -0.9997603425502441410973077452249560802034":
+ildouble: 2
+ldouble: 2
+Test "tan (-0xc.90cp-4) == -0.9998823910588060302788513970802357770031":
+ildouble: 2
+ldouble: 2
+Test "tan (-0xc.90ep-4) == -0.9999434208994808753305784795924711152508":
+ildouble: 2
+ldouble: 2
+Test "tan (-0xc.90f8p-4) == -0.9999891957244072765118898375645469865764":
+ildouble: 2
+ldouble: 2
+Test "tan (-0xc.90fcp-4) == -0.9999968250656122402859679132395522927393":
+ildouble: 1
+ldouble: 1
+Test "tan (-0xc.90fd8p-4) == -0.9999996860835706212861509874451585282616":
+ildouble: 1
+ldouble: 1
+Test "tan (-0xc.90fdap-4) == -0.9999999245021033010474530133665235922808":
+ildouble: 1
+ldouble: 1
+Test "tan (-0xc.92p-4) == -1.0004928571392300571266638743539017593717":
+ildouble: 1
+ldouble: 1
+Test "tan (-0xc.9p-4) == -0.9995162902115457818029468900654150261381":
+ildouble: 1
+ldouble: 1
+Test "tan (0xc.908p-4) == 0.9997603425502441410973077452249560802034":
+ildouble: 2
+ldouble: 2
+Test "tan (0xc.90cp-4) == 0.9998823910588060302788513970802357770031":
+ildouble: 2
+ldouble: 2
+Test "tan (0xc.90ep-4) == 0.9999434208994808753305784795924711152508":
+ildouble: 2
+ldouble: 2
+Test "tan (0xc.90f8p-4) == 0.9999891957244072765118898375645469865764":
+ildouble: 2
+ldouble: 2
+Test "tan (0xc.90fcp-4) == 0.9999968250656122402859679132395522927393":
+ildouble: 1
+ldouble: 1
+Test "tan (0xc.90fd8p-4) == 0.9999996860835706212861509874451585282616":
+ildouble: 1
+ldouble: 1
+Test "tan (0xc.90fdap-4) == 0.9999999245021033010474530133665235922808":
+ildouble: 1
+ldouble: 1
+Test "tan (0xc.92p-4) == 1.0004928571392300571266638743539017593717":
+ildouble: 1
+ldouble: 1
+Test "tan (0xc.9p-4) == 0.9995162902115457818029468900654150261381":
+ildouble: 1
+ldouble: 1
Test "tan (pi/4) == 1":
ildouble: 1
ldouble: 1
@@ -1862,6 +2370,41 @@ double: 1
idouble: 1
ildouble: 1
ldouble: 1
+Test "y0 (0x1p-10) == -4.4865150767109739412411806297168793661098":
+double: 1
+idouble: 1
+Test "y0 (0x1p-100) == -4.420092432563900590456563035154802121284e+1":
+ildouble: 1
+ldouble: 1
+Test "y0 (0x1p-110) == -4.861363632869203777249475899390797503250e+1":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "y0 (0x1p-20) == -8.8992283012125827603076426611387876938160":
+float: 1
+ifloat: 1
+Test "y0 (0x1p-30) == -1.3311940304267782826037118027401817264906e+1":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "y0 (0x1p-40) == -1.7724652307320814696990854700366226762563e+1":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "y0 (0x1p-50) == -2.2137364310373846564919987139743760738155e+1":
+float: 1
+ifloat: 1
+Test "y0 (0x1p-70) == -3.0962788316479910300778244424468159753887e+1":
+double: 1
+idouble: 1
+Test "y0 (0x1p-80) == -3.5375500319532942168707373066828113573541e+1":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
Test "y0 (1.0) == 0.0882569642156769579829267660235151628":
double: 2
float: 1
@@ -1899,6 +2442,12 @@ double: 1
idouble: 1
ildouble: 1
ldouble: 1
+Test "y1 (0x1p-10) == -6.5190099301063115047395187618929589514382e+02":
+double: 1
+idouble: 1
+Test "y1 (0x1p-20) == -6.6754421443450423911167962313100637952285e+05":
+ildouble: 1
+ldouble: 1
Test "y1 (1.5) == -0.412308626973911295952829820633445323":
float: 1
ifloat: 1
@@ -2233,28 +2782,30 @@ double: 1
float: 1
idouble: 1
ifloat: 1
-ildouble: 2
-ldouble: 2
-
-Function: Imaginary part of "clog":
ildouble: 1
ldouble: 1
-Function: Real part of "clog10":
-double: 1
+Function: Imaginary part of "clog":
float: 1
-idouble: 1
ifloat: 1
-ildouble: 3
-ldouble: 3
+ildouble: 2
+ldouble: 2
+
+Function: Real part of "clog10":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+ildouble: 2
+ldouble: 2
Function: Imaginary part of "clog10":
double: 1
float: 1
idouble: 1
ifloat: 1
-ildouble: 1
-ldouble: 1
+ildouble: 2
+ldouble: 2
Function: "cos":
double: 2
@@ -2317,8 +2868,8 @@ double: 2
float: 4
idouble: 2
ifloat: 4
-ildouble: 2
-ldouble: 2
+ildouble: 4
+ldouble: 4
Function: Imaginary part of "cpow":
double: 2
@@ -2381,16 +2932,70 @@ ldouble: 2
Function: Imaginary part of "ctan":
double: 1
idouble: 1
+ildouble: 2
+ldouble: 2
+
+Function: Real part of "ctan_downward":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 3
+ldouble: 3
+
+Function: Imaginary part of "ctan_downward":
+float: 1
+ifloat: 1
+ildouble: 10
+ldouble: 10
+
+Function: Real part of "ctan_tonearest":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: Imaginary part of "ctan_tonearest":
+float: 1
+ifloat: 1
ildouble: 1
ldouble: 1
+Function: Real part of "ctan_towardzero":
+float: 1
+ifloat: 1
+ildouble: 4
+ldouble: 4
+
+Function: Imaginary part of "ctan_towardzero":
+float: 1
+ifloat: 1
+ildouble: 13
+ldouble: 13
+
+Function: Real part of "ctan_upward":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 6
+ldouble: 6
+
+Function: Imaginary part of "ctan_upward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 10
+ldouble: 10
+
Function: Real part of "ctanh":
double: 1
float: 1
idouble: 1
ifloat: 1
-ildouble: 1
-ldouble: 1
+ildouble: 2
+ldouble: 2
Function: Imaginary part of "ctanh":
double: 1
@@ -2400,6 +3005,60 @@ ifloat: 2
ildouble: 2
ldouble: 2
+Function: Real part of "ctanh_downward":
+float: 1
+ifloat: 1
+ildouble: 10
+ldouble: 10
+
+Function: Imaginary part of "ctanh_downward":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 3
+ldouble: 3
+
+Function: Real part of "ctanh_tonearest":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: Imaginary part of "ctanh_tonearest":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: Real part of "ctanh_towardzero":
+float: 1
+ifloat: 1
+ildouble: 13
+ldouble: 13
+
+Function: Imaginary part of "ctanh_towardzero":
+float: 1
+ifloat: 1
+ildouble: 4
+ldouble: 4
+
+Function: Real part of "ctanh_upward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 10
+ldouble: 10
+
+Function: Imaginary part of "ctanh_upward":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 6
+ldouble: 6
+
Function: "erf":
double: 1
idouble: 1
@@ -2603,8 +3262,8 @@ ldouble: 1
Function: "tan":
double: 1
idouble: 1
-ildouble: 1
-ldouble: 1
+ildouble: 2
+ldouble: 2
Function: "tan_downward":
float: 1
diff --git a/libc/ports/sysdeps/tile/bits/byteswap.h b/libc/ports/sysdeps/tile/bits/byteswap.h
index 8e610c6fc..4d1b25549 100644
--- a/libc/ports/sysdeps/tile/bits/byteswap.h
+++ b/libc/ports/sysdeps/tile/bits/byteswap.h
@@ -23,10 +23,12 @@
#ifndef _BITS_BYTESWAP_H
#define _BITS_BYTESWAP_H 1
+#include <bits/types.h>
+
/* gcc __builtin_bswap64() can constant-fold, etc, so always use it. */
#define __bswap_16(x) ((unsigned short)(__builtin_bswap32(x) >> 16))
#define __bswap_32(x) ((unsigned int)__builtin_bswap32(x))
-#define __bswap_64(x) ((unsigned long long)__builtin_bswap64(x))
+#define __bswap_64(x) ((__uint64_t)__builtin_bswap64(x))
#define __bswap_constant_16(x) __bswap_16(x)
#define __bswap_constant_32(x) __bswap_32(x)
diff --git a/libc/ports/sysdeps/tile/libm-test-ulps b/libc/ports/sysdeps/tile/libm-test-ulps
index 584e57089..eddae42c7 100644
--- a/libc/ports/sysdeps/tile/libm-test-ulps
+++ b/libc/ports/sysdeps/tile/libm-test-ulps
@@ -4,6 +4,9 @@
Test "atan2 (-0.75, -1.0) == -2.49809154479650885165983415456218025":
float: 1
ifloat: 1
+Test "atan2 (-max_value, -min_value) == -pi/2":
+float: 1
+ifloat: 1
Test "atan2 (0.75, -1.0) == 2.49809154479650885165983415456218025":
float: 1
ifloat: 1
@@ -1308,6 +1311,34 @@ idouble: 1
Test "y0 (0x1.ff00000000002p+840) == 1.846591691699331493194965158699937660696e-127":
double: 1
idouble: 1
+Test "y0 (0x1p-10) == -4.4865150767109739412411806297168793661098":
+double: 1
+idouble: 1
+Test "y0 (0x1p-110) == -4.861363632869203777249475899390797503250e+1":
+double: 1
+idouble: 1
+Test "y0 (0x1p-20) == -8.8992283012125827603076426611387876938160":
+float: 1
+ifloat: 1
+Test "y0 (0x1p-30) == -1.3311940304267782826037118027401817264906e+1":
+float: 1
+ifloat: 1
+Test "y0 (0x1p-40) == -1.7724652307320814696990854700366226762563e+1":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "y0 (0x1p-50) == -2.2137364310373846564919987139743760738155e+1":
+float: 1
+ifloat: 1
+Test "y0 (0x1p-70) == -3.0962788316479910300778244424468159753887e+1":
+double: 1
+idouble: 1
+Test "y0 (0x1p-80) == -3.5375500319532942168707373066828113573541e+1":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
Test "y0 (1.0) == 0.0882569642156769579829267660235151628":
double: 2
float: 1
@@ -1334,6 +1365,9 @@ idouble: 1
Test "y1 (0x1.27e204p+99) == -8.881610148467797208469612080785210013461e-16":
double: 1
idouble: 1
+Test "y1 (0x1p-10) == -6.5190099301063115047395187618929589514382e+02":
+double: 1
+idouble: 1
Test "y1 (1.5) == -0.412308626973911295952829820633445323":
float: 1
ifloat: 1
diff --git a/libc/ports/sysdeps/tile/s_fma.c b/libc/ports/sysdeps/tile/s_fma.c
index 5be586562..c84a9bb2d 100644
--- a/libc/ports/sysdeps/tile/s_fma.c
+++ b/libc/ports/sysdeps/tile/s_fma.c
@@ -1,8 +1,4 @@
/* tile does not support the rounding modes required by the ieee754/dbl-64
implementation, but it's still better than the generic implementation. */
-#define libc_feholdexcept_setround(e, x) do { (void) (e); } while (0)
-#define libc_feupdateenv_test(e, x) ((void) (e), 0)
-#define libc_fetestexcept(x) 0
-
#include <sysdeps/ieee754/dbl-64/s_fma.c>
diff --git a/libc/ports/sysdeps/tile/s_fmaf.c b/libc/ports/sysdeps/tile/s_fmaf.c
index 92d66b257..84e9adc41 100644
--- a/libc/ports/sysdeps/tile/s_fmaf.c
+++ b/libc/ports/sysdeps/tile/s_fmaf.c
@@ -1,8 +1,4 @@
/* tile does not support the rounding modes required by the ieee754/dbl-64
implementation, but it's still better than the generic implementation. */
-#define libc_feholdexcept_setround(e, x) do { (void) (e); } while (0)
-#define libc_feupdateenv_test(e, x) ((void) (e), 0)
-#define libc_fetestexcept(x) 0
-
#include <sysdeps/ieee754/dbl-64/s_fmaf.c>
diff --git a/libc/ports/sysdeps/unix/sysv/linux/aarch64/dl-cache.h b/libc/ports/sysdeps/unix/sysv/linux/aarch64/dl-cache.h
new file mode 100644
index 000000000..1aa1a84af
--- /dev/null
+++ b/libc/ports/sysdeps/unix/sysv/linux/aarch64/dl-cache.h
@@ -0,0 +1,45 @@
+/* Support for reading /etc/ld.so.cache files written by Linux ldconfig.
+ Copyright (C) 2003-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 <ldconfig.h>
+
+#define _DL_CACHE_DEFAULT_ID (FLAG_AARCH64_LIB64 | FLAG_ELF_LIBC6)
+
+#define _dl_cache_check_flags(flags) \
+ ((flags) == _DL_CACHE_DEFAULT_ID)
+
+#define add_system_dir(dir) \
+ do \
+ { \
+ size_t len = strlen (dir); \
+ char path[len + 3]; \
+ memcpy (path, dir, len + 1); \
+ if (len >= 6 && ! memcmp (path + len - 6, "/lib64", 6)) \
+ { \
+ len -= 2; \
+ path[len] = '\0'; \
+ } \
+ add_dir (path); \
+ if (len >= 4 && ! memcmp (path + len - 4, "/lib", 4)) \
+ { \
+ memcpy (path + len, "64", 3); \
+ add_dir (path); \
+ } \
+ } while (0)
+
+#include_next <dl-cache.h>
diff --git a/libc/ports/sysdeps/unix/sysv/linux/aarch64/nptl/lowlevellock.h b/libc/ports/sysdeps/unix/sysv/linux/aarch64/nptl/lowlevellock.h
index e4f0c9427..705cffd35 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/aarch64/nptl/lowlevellock.h
+++ b/libc/ports/sysdeps/unix/sysv/linux/aarch64/nptl/lowlevellock.h
@@ -96,7 +96,7 @@
__lll_private_flag (__op, private), \
(val), (timespec), NULL /* Unused. */, \
FUTEX_BITSET_MATCH_ANY); \
- INTERNAL_SYSCALL_ERROR_P (__ret, __err) ? -__ret : __ret; \
+ __ret; \
})
#define lll_futex_wake(futexp, nr, private) \
diff --git a/libc/ports/sysdeps/unix/sysv/linux/arm/Makefile b/libc/ports/sysdeps/unix/sysv/linux/arm/Makefile
index bda3ea9f7..be7946e96 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/arm/Makefile
+++ b/libc/ports/sysdeps/unix/sysv/linux/arm/Makefile
@@ -70,25 +70,16 @@ LDFLAGS-tst-rfc3484-2 += $(common-objpfx)csu/libc-do-syscall.o
LDFLAGS-tst-rfc3484-3 += $(common-objpfx)csu/libc-do-syscall.o
endif
-define default-abi-prog
-echo '#ifdef __ARM_PCS_VFP';
-echo 'hard';
-echo '#else';
-echo 'soft';
-echo '#endif'
-endef
-default-abi := $(strip $(shell \
- ($(default-abi-prog)) | $(CC) $(CFLAGS) $(CPPFLAGS) -E -P -))
-ifeq ($(default-abi),hard)
-# OK.
-else
-ifneq ($(default-abi),soft)
-Unknown ABI, must be "hard" or "soft".
-endif
+# Get value of default-abi.
+include $(common-objpfx)default-abi.make
+
+abi-variants := soft hard
+
+ifeq (,$(filter $(default-abi),$(abi-variants)))
+Unknown ABI, must be one of $(abi-variants)
endif
abi-includes :=
-abi-variants := soft hard
abi-soft-options := -U__ARM_PCS_VFP
abi-soft-condition := !defined __ARM_PCS_VFP
abi-soft-ld-soname := ld-linux.so.3
diff --git a/libc/ports/sysdeps/unix/sysv/linux/hppa/____longjmp_chk.c b/libc/ports/sysdeps/unix/sysv/linux/hppa/____longjmp_chk.c
new file mode 100644
index 000000000..46357ddba
--- /dev/null
+++ b/libc/ports/sysdeps/unix/sysv/linux/hppa/____longjmp_chk.c
@@ -0,0 +1,47 @@
+/* Copyright (C) 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
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GCC; see the file COPYING. If not, write to the Free
+ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301, USA. */
+
+#include <stdio.h>
+#include <signal.h>
+#include <sysdep.h>
+#define __longjmp ____longjmp_chk
+#define CHECK_SP(sp) \
+ do { \
+ register unsigned long this_sp asm ("r30"); \
+ /* The stack grows up, therefore frames that were created and then \
+ destroyed must all have stack values higher than ours. */ \
+ if ((unsigned long) (sp) > this_sp) \
+ { \
+ struct sigaltstack oss; \
+ INTERNAL_SYSCALL_DECL (err); \
+ int result = INTERNAL_SYSCALL (sigaltstack, err, 2, NULL, &oss);\
+ /* If we aren't using an alternate stack then we have already \
+ shown that we are jumping to a frame that doesn't exist so \
+ error out. If we are using an alternate stack we must prove \
+ that we are jumping *out* of the alternate stack. Note that \
+ the check for that is the same as that for _STACK_GROWS_UP \
+ as for _STACK_GROWS_DOWN. */ \
+ if (!INTERNAL_SYSCALL_ERROR_P (result, err) \
+ && ((oss.ss_flags & SS_ONSTACK) == 0 \
+ || ((unsigned long) oss.ss_sp + oss.ss_size \
+ - (unsigned long) (sp)) < oss.ss_size)) \
+ __fortify_fail ("longjmp causes uninitialized stack frame"); \
+ } \
+ } while (0)
+
+#include <__longjmp.c>
diff --git a/libc/ports/sysdeps/unix/sysv/linux/hppa/bits/socket.h b/libc/ports/sysdeps/unix/sysv/linux/hppa/bits/socket.h
deleted file mode 100644
index 7870f751e..000000000
--- a/libc/ports/sysdeps/unix/sysv/linux/hppa/bits/socket.h
+++ /dev/null
@@ -1,444 +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_CAIF 37 /* CAIF sockets. */
-#define PF_ALG 38 /* Algorithm sockets. */
-#define PF_NFC 39 /* NFC sockets. */
-#define PF_MAX 40 /* 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_CAIF PF_CAIF
-#define AF_ALG PF_ALG
-#define AF_NFC PF_NFC
-#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 (struct cmsghdr *) 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 (struct cmsghdr *) 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/libc/ports/sysdeps/unix/sysv/linux/hppa/bits/socket_type.h b/libc/ports/sysdeps/unix/sysv/linux/hppa/bits/socket_type.h
new file mode 100644
index 000000000..ae2df6dd8
--- /dev/null
+++ b/libc/ports/sysdeps/unix/sysv/linux/hppa/bits/socket_type.h
@@ -0,0 +1,55 @@
+/* Define enum __socket_type for Linux/HP-PARISC.
+ 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/>. */
+
+#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/libc/ports/sysdeps/unix/sysv/linux/hppa/mmap.c b/libc/ports/sysdeps/unix/sysv/linux/hppa/mmap.c
index 420d6567a..12e700dcb 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/hppa/mmap.c
+++ b/libc/ports/sysdeps/unix/sysv/linux/hppa/mmap.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1994-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
@@ -36,7 +36,7 @@ __mmap (__ptr_t addr, size_t len, int prot, int flags, int fd, off_t offset)
__ptr_t ret;
- ret = INLINE_SYSCALL(mmap, 6, addr, len, prot, flags, fd, offset);
+ ret = (__ptr_t) INLINE_SYSCALL (mmap, 6, addr, len, prot, flags, fd, offset);
/* check if it's really a negative number */
if(((unsigned long)ret & 0xfffff000) == 0xfffff000)
diff --git a/libc/ports/sysdeps/unix/sysv/linux/hppa/nptl/pthread_once.c b/libc/ports/sysdeps/unix/sysv/linux/hppa/nptl/pthread_once.c
index 974819ead..b920ebb22 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/hppa/nptl/pthread_once.c
+++ b/libc/ports/sysdeps/unix/sysv/linux/hppa/nptl/pthread_once.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
@@ -90,4 +90,4 @@ __pthread_once (once_control, init_routine)
return 0;
}
weak_alias (__pthread_once, pthread_once)
-strong_alias (__pthread_once, __pthread_once_internal)
+hidden_def (__pthread_once)
diff --git a/libc/ports/sysdeps/unix/sysv/linux/m68k/nptl/lowlevellock.h b/libc/ports/sysdeps/unix/sysv/linux/m68k/nptl/lowlevellock.h
index 4dbed8d37..73fdaeaaa 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/m68k/nptl/lowlevellock.h
+++ b/libc/ports/sysdeps/unix/sysv/linux/m68k/nptl/lowlevellock.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010 Free Software Foundation, Inc.
+/* Copyright (C) 2010-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Maxim Kuvyrkov <maxim@codesourcery.com>, 2010.
@@ -88,6 +88,18 @@
__ret; \
})
+#define lll_futex_timed_wait_bitset(futexp, val, timespec, clockbit, private) \
+ ({ \
+ INTERNAL_SYSCALL_DECL (__err); \
+ long int __ret; \
+ int __op = FUTEX_WAIT_BITSET | clockbit; \
+ __ret = INTERNAL_SYSCALL (futex, __err, 6, (long) (futexp), \
+ __lll_private_flag (__op, private), \
+ (val), (timespec), NULL /* Unused. */, \
+ FUTEX_BITSET_MATCH_ANY); \
+ __ret; \
+ })
+
#define lll_futex_wake(futexp, nr, private) \
({ \
INTERNAL_SYSCALL_DECL (__err); \
diff --git a/libc/ports/sysdeps/unix/sysv/linux/m68k/nptl/sysdep-cancel.h b/libc/ports/sysdeps/unix/sysv/linux/m68k/nptl/sysdep-cancel.h
index 249e0e29f..e29589809 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/m68k/nptl/sysdep-cancel.h
+++ b/libc/ports/sysdeps/unix/sysv/linux/m68k/nptl/sysdep-cancel.h
@@ -69,8 +69,6 @@
# define _DOCARGS_2(n) DOCARGS_0 move.l n+4(%sp), %d2; _DOCARGS_1 (n)
# define UNDOCARGS_2 UNDOCARGS_0
-/* TODO: We can optimize DOCARGS_{3, 4} by saving registers to a0 and a1
- instead of pushing them on stack. */
# define DOCARGS_3 _DOCARGS_3 (12)
# define _DOCARGS_3(n) move.l %d3, -(%sp); \
cfi_adjust_cfa_offset (4); cfi_rel_offset (%d3, 0); \
@@ -86,9 +84,11 @@
cfi_adjust_cfa_offset (-4); cfi_restore (%d4);
# define DOCARGS_5 _DOCARGS_5 (20)
-# define _DOCARGS_5(n) move.l %d5, %a1; cfi_register (%d5, a1); \
- move.l n(%sp), %d5; _DOCARGS_4 (n-4)
-# define UNDOCARGS_5 UNDOCARGS_4 move.l %a1, %d5; cfi_restore (%d5);
+# define _DOCARGS_5(n) move.l %d5, -(%sp); \
+ cfi_adjust_cfa_offset (4); cfi_rel_offset (%d5, 0); \
+ move.l n+4(%sp), %d5; _DOCARGS_4 (n)
+# define UNDOCARGS_5 UNDOCARGS_4 move.l (%sp)+, %d5; \
+ cfi_adjust_cfa_offset (-4); cfi_restore (%d5);
# define DOCARGS_6 _DOCARGS_6 (24)
# define _DOCARGS_6(n) move.l n(%sp), %a0; _DOCARGS_5 (n-4)
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/____longjmp_chk.c b/libc/ports/sysdeps/unix/sysv/linux/mips/____longjmp_chk.c
index d8da27024..943b40414 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/mips/____longjmp_chk.c
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/____longjmp_chk.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009 Free Software Foundation, Inc.
+/* Copyright (C) 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
@@ -29,7 +29,7 @@
int ret = __sigaltstack (NULL, &ss); \
if (ret == 0 \
&& (!(ss.ss_flags & SS_ONSTACK) \
- || ((unsigned sp_type) ((sp_type) ss.ss_sp \
+ || ((unsigned sp_type) ((sp_type) (long) ss.ss_sp \
+ (sp_type) ss.ss_size \
- sp_saved) \
< ss.ss_size))) \
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h b/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h
index 8c024b024..2b683a986 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h
@@ -60,13 +60,13 @@
result_var; })
#undef INTERNAL_SYSCALL_DECL
-#define INTERNAL_SYSCALL_DECL(err) long err
+#define INTERNAL_SYSCALL_DECL(err) long err __attribute__ ((unused))
#undef INTERNAL_SYSCALL_ERROR_P
-#define INTERNAL_SYSCALL_ERROR_P(val, err) ((long) (err))
+#define INTERNAL_SYSCALL_ERROR_P(val, err) ((void) (val), (long) (err))
#undef INTERNAL_SYSCALL_ERRNO
-#define INTERNAL_SYSCALL_ERRNO(val, err) (val)
+#define INTERNAL_SYSCALL_ERRNO(val, err) ((void) (err), val)
#undef INTERNAL_SYSCALL
#define INTERNAL_SYSCALL(name, err, nr, args...) \
@@ -104,7 +104,7 @@
\
{ \
register long __v0 asm("$2") ncs_init; \
- register long __a0 asm("$4") = (long) arg1; \
+ register long __a0 asm("$4") = (long) (arg1); \
register long __a3 asm("$7"); \
__asm__ volatile ( \
".set\tnoreorder\n\t" \
@@ -126,8 +126,8 @@
\
{ \
register long __v0 asm("$2") ncs_init; \
- register long __a0 asm("$4") = (long) arg1; \
- register long __a1 asm("$5") = (long) arg2; \
+ register long __a0 asm("$4") = (long) (arg1); \
+ register long __a1 asm("$5") = (long) (arg2); \
register long __a3 asm("$7"); \
__asm__ volatile ( \
".set\tnoreorder\n\t" \
@@ -149,9 +149,9 @@
\
{ \
register long __v0 asm("$2") ncs_init; \
- register long __a0 asm("$4") = (long) arg1; \
- register long __a1 asm("$5") = (long) arg2; \
- register long __a2 asm("$6") = (long) arg3; \
+ register long __a0 asm("$4") = (long) (arg1); \
+ register long __a1 asm("$5") = (long) (arg2); \
+ register long __a2 asm("$6") = (long) (arg3); \
register long __a3 asm("$7"); \
__asm__ volatile ( \
".set\tnoreorder\n\t" \
@@ -173,10 +173,10 @@
\
{ \
register long __v0 asm("$2") ncs_init; \
- register long __a0 asm("$4") = (long) arg1; \
- register long __a1 asm("$5") = (long) arg2; \
- register long __a2 asm("$6") = (long) arg3; \
- register long __a3 asm("$7") = (long) arg4; \
+ register long __a0 asm("$4") = (long) (arg1); \
+ register long __a1 asm("$5") = (long) (arg2); \
+ register long __a2 asm("$6") = (long) (arg3); \
+ register long __a3 asm("$7") = (long) (arg4); \
__asm__ volatile ( \
".set\tnoreorder\n\t" \
cs_init \
@@ -205,10 +205,10 @@
FORCE_FRAME_POINTER; \
{ \
register long __v0 asm("$2") ncs_init; \
- register long __a0 asm("$4") = (long) arg1; \
- register long __a1 asm("$5") = (long) arg2; \
- register long __a2 asm("$6") = (long) arg3; \
- register long __a3 asm("$7") = (long) arg4; \
+ register long __a0 asm("$4") = (long) (arg1); \
+ register long __a1 asm("$5") = (long) (arg2); \
+ register long __a2 asm("$6") = (long) (arg3); \
+ register long __a3 asm("$7") = (long) (arg4); \
__asm__ volatile ( \
".set\tnoreorder\n\t" \
"subu\t$29, 32\n\t" \
@@ -219,7 +219,7 @@
".set\treorder" \
: "=r" (__v0), "+r" (__a3) \
: input, "r" (__a0), "r" (__a1), "r" (__a2), \
- "r" ((long)arg5) \
+ "r" ((long) (arg5)) \
: __SYSCALL_CLOBBERS); \
err = __a3; \
_sys_result = __v0; \
@@ -234,10 +234,10 @@
FORCE_FRAME_POINTER; \
{ \
register long __v0 asm("$2") ncs_init; \
- register long __a0 asm("$4") = (long) arg1; \
- register long __a1 asm("$5") = (long) arg2; \
- register long __a2 asm("$6") = (long) arg3; \
- register long __a3 asm("$7") = (long) arg4; \
+ register long __a0 asm("$4") = (long) (arg1); \
+ register long __a1 asm("$5") = (long) (arg2); \
+ register long __a2 asm("$6") = (long) (arg3); \
+ register long __a3 asm("$7") = (long) (arg4); \
__asm__ volatile ( \
".set\tnoreorder\n\t" \
"subu\t$29, 32\n\t" \
@@ -249,7 +249,7 @@
".set\treorder" \
: "=r" (__v0), "+r" (__a3) \
: input, "r" (__a0), "r" (__a1), "r" (__a2), \
- "r" ((long)arg5), "r" ((long)arg6) \
+ "r" ((long) (arg5)), "r" ((long) (arg6)) \
: __SYSCALL_CLOBBERS); \
err = __a3; \
_sys_result = __v0; \
@@ -264,10 +264,10 @@
FORCE_FRAME_POINTER; \
{ \
register long __v0 asm("$2") ncs_init; \
- register long __a0 asm("$4") = (long) arg1; \
- register long __a1 asm("$5") = (long) arg2; \
- register long __a2 asm("$6") = (long) arg3; \
- register long __a3 asm("$7") = (long) arg4; \
+ register long __a0 asm("$4") = (long) (arg1); \
+ register long __a1 asm("$5") = (long) (arg2); \
+ register long __a2 asm("$6") = (long) (arg3); \
+ register long __a3 asm("$7") = (long) (arg4); \
__asm__ volatile ( \
".set\tnoreorder\n\t" \
"subu\t$29, 32\n\t" \
@@ -280,7 +280,7 @@
".set\treorder" \
: "=r" (__v0), "+r" (__a3) \
: input, "r" (__a0), "r" (__a1), "r" (__a2), \
- "r" ((long)arg5), "r" ((long)arg6), "r" ((long)arg7) \
+ "r" ((long) (arg5)), "r" ((long) (arg6)), "r" ((long) (arg7)) \
: __SYSCALL_CLOBBERS); \
err = __a3; \
_sys_result = __v0; \
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h b/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h
index 98088d32f..23b1c9772 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h
@@ -64,13 +64,13 @@
result_var; })
#undef INTERNAL_SYSCALL_DECL
-#define INTERNAL_SYSCALL_DECL(err) long err
+#define INTERNAL_SYSCALL_DECL(err) long err __attribute__ ((unused))
#undef INTERNAL_SYSCALL_ERROR_P
-#define INTERNAL_SYSCALL_ERROR_P(val, err) ((long) (err))
+#define INTERNAL_SYSCALL_ERROR_P(val, err) ((void) (val), (long) (err))
#undef INTERNAL_SYSCALL_ERRNO
-#define INTERNAL_SYSCALL_ERRNO(val, err) (val)
+#define INTERNAL_SYSCALL_ERRNO(val, err) ((void) (err), val)
#undef INTERNAL_SYSCALL
#define INTERNAL_SYSCALL(name, err, nr, args...) \
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/sendfile64.c b/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/sendfile64.c
new file mode 100644
index 000000000..4c451bd09
--- /dev/null
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/sendfile64.c
@@ -0,0 +1 @@
+/* sendfile64 is alias of sendfile syscall. */
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/syscalls.list b/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/syscalls.list
index c94fe75a7..b23a2a1d1 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/syscalls.list
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/syscalls.list
@@ -8,3 +8,5 @@ fanotify_mark EXTRA fanotify_mark i:iiiis fanotify_mark
fstatfs - fstatfs i:ip __fstatfs fstatfs fstatfs64 __fstatfs64
statfs - statfs i:sp __statfs statfs statfs64 __statfs64
+
+sendfile - sendfile i:iipi sendfile sendfile64
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h b/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h
index 0baa94f1d..02f196a83 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h
@@ -60,13 +60,13 @@
result_var; })
#undef INTERNAL_SYSCALL_DECL
-#define INTERNAL_SYSCALL_DECL(err) long err
+#define INTERNAL_SYSCALL_DECL(err) long err __attribute__ ((unused))
#undef INTERNAL_SYSCALL_ERROR_P
-#define INTERNAL_SYSCALL_ERROR_P(val, err) ((long) (err))
+#define INTERNAL_SYSCALL_ERROR_P(val, err) ((void) (val), (long) (err))
#undef INTERNAL_SYSCALL_ERRNO
-#define INTERNAL_SYSCALL_ERRNO(val, err) (val)
+#define INTERNAL_SYSCALL_ERRNO(val, err) ((void) (err), val)
#undef INTERNAL_SYSCALL
#define INTERNAL_SYSCALL(name, err, nr, args...) \
@@ -104,7 +104,7 @@
\
{ \
register long __v0 asm("$2") ncs_init; \
- register long __a0 asm("$4") = (long) arg1; \
+ register long __a0 asm("$4") = (long) (arg1); \
register long __a3 asm("$7"); \
__asm__ volatile ( \
".set\tnoreorder\n\t" \
@@ -126,8 +126,8 @@
\
{ \
register long __v0 asm("$2") ncs_init; \
- register long __a0 asm("$4") = (long) arg1; \
- register long __a1 asm("$5") = (long) arg2; \
+ register long __a0 asm("$4") = (long) (arg1); \
+ register long __a1 asm("$5") = (long) (arg2); \
register long __a3 asm("$7"); \
__asm__ volatile ( \
".set\tnoreorder\n\t" \
@@ -149,9 +149,9 @@
\
{ \
register long __v0 asm("$2") ncs_init; \
- register long __a0 asm("$4") = (long) arg1; \
- register long __a1 asm("$5") = (long) arg2; \
- register long __a2 asm("$6") = (long) arg3; \
+ register long __a0 asm("$4") = (long) (arg1); \
+ register long __a1 asm("$5") = (long) (arg2); \
+ register long __a2 asm("$6") = (long) (arg3); \
register long __a3 asm("$7"); \
__asm__ volatile ( \
".set\tnoreorder\n\t" \
@@ -173,10 +173,10 @@
\
{ \
register long __v0 asm("$2") ncs_init; \
- register long __a0 asm("$4") = (long) arg1; \
- register long __a1 asm("$5") = (long) arg2; \
- register long __a2 asm("$6") = (long) arg3; \
- register long __a3 asm("$7") = (long) arg4; \
+ register long __a0 asm("$4") = (long) (arg1); \
+ register long __a1 asm("$5") = (long) (arg2); \
+ register long __a2 asm("$6") = (long) (arg3); \
+ register long __a3 asm("$7") = (long) (arg4); \
__asm__ volatile ( \
".set\tnoreorder\n\t" \
cs_init \
@@ -197,11 +197,11 @@
\
{ \
register long __v0 asm("$2") ncs_init; \
- register long __a0 asm("$4") = (long) arg1; \
- register long __a1 asm("$5") = (long) arg2; \
- register long __a2 asm("$6") = (long) arg3; \
- register long __a3 asm("$7") = (long) arg4; \
- register long __a4 asm("$8") = (long) arg5; \
+ register long __a0 asm("$4") = (long) (arg1); \
+ register long __a1 asm("$5") = (long) (arg2); \
+ register long __a2 asm("$6") = (long) (arg3); \
+ register long __a3 asm("$7") = (long) (arg4); \
+ register long __a4 asm("$8") = (long) (arg5); \
__asm__ volatile ( \
".set\tnoreorder\n\t" \
cs_init \
@@ -222,12 +222,12 @@
\
{ \
register long __v0 asm("$2") ncs_init; \
- register long __a0 asm("$4") = (long) arg1; \
- register long __a1 asm("$5") = (long) arg2; \
- register long __a2 asm("$6") = (long) arg3; \
- register long __a3 asm("$7") = (long) arg4; \
- register long __a4 asm("$8") = (long) arg5; \
- register long __a5 asm("$9") = (long) arg6; \
+ register long __a0 asm("$4") = (long) (arg1); \
+ register long __a1 asm("$5") = (long) (arg2); \
+ register long __a2 asm("$6") = (long) (arg3); \
+ register long __a3 asm("$7") = (long) (arg4); \
+ register long __a4 asm("$8") = (long) (arg5); \
+ register long __a5 asm("$9") = (long) (arg6); \
__asm__ volatile ( \
".set\tnoreorder\n\t" \
cs_init \
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/register-dump.h b/libc/ports/sysdeps/unix/sysv/linux/mips/register-dump.h
index 186228119..0156910e4 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/mips/register-dump.h
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/register-dump.h
@@ -17,9 +17,26 @@
License along with the GNU C Library. If not, see
<http://www.gnu.org/licenses/>. */
+#include <sgidefs.h>
#include <sys/uio.h>
#include <_itoa.h>
+#if _MIPS_SIM == _ABIO32
+# define CTX_TYPE struct sigcontext *
+# define CTX_REG(ctx, i) ((ctx)->sc_regs[(i)])
+# define CTX_PC(ctx) ((ctx)->sc_pc)
+# define CTX_MDHI(ctx) ((ctx)->sc_mdhi)
+# define CTX_MDLO(ctx) ((ctx)->sc_mdlo)
+# define REG_HEX_SIZE 8
+#else
+# define CTX_TYPE ucontext_t *
+# define CTX_REG(ctx, i) ((ctx)->uc_mcontext.gregs[(i)])
+# define CTX_PC(ctx) ((ctx)->uc_mcontext.pc)
+# define CTX_MDHI(ctx) ((ctx)->uc_mcontext.mdhi)
+# define CTX_MDLO(ctx) ((ctx)->uc_mcontext.mdhi)
+# define REG_HEX_SIZE 16
+#endif
+
/* We will print the register dump in this format:
R0 XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX
@@ -32,7 +49,7 @@
*/
static void
-hexvalue (unsigned long int value, char *buf, size_t len)
+hexvalue (_ITOA_WORD_TYPE value, char *buf, size_t len)
{
char *cp = _itoa_word (value, buf + len, 16, 0);
while (cp > buf)
@@ -40,9 +57,9 @@ hexvalue (unsigned long int value, char *buf, size_t len)
}
static void
-register_dump (int fd, struct sigcontext *ctx)
+register_dump (int fd, CTX_TYPE ctx)
{
- char regs[38][8];
+ char regs[38][REG_HEX_SIZE];
struct iovec iov[38 * 2 + 10];
size_t nr = 0;
int i;
@@ -58,40 +75,40 @@ register_dump (int fd, struct sigcontext *ctx)
/* Generate strings of register contents. */
for (i = 0; i < 32; i++)
- hexvalue (ctx->sc_regs[i], regs[i], 8);
- hexvalue (ctx->sc_pc, regs[32], 8);
- hexvalue (ctx->sc_mdhi, regs[33], 8);
- hexvalue (ctx->sc_mdlo, regs[34], 8);
+ hexvalue (CTX_REG (ctx, i), regs[i], REG_HEX_SIZE);
+ hexvalue (CTX_PC (ctx), regs[32], REG_HEX_SIZE);
+ hexvalue (CTX_MDHI (ctx), regs[33], REG_HEX_SIZE);
+ hexvalue (CTX_MDLO (ctx), regs[34], REG_HEX_SIZE);
/* Generate the output. */
ADD_STRING ("Register dump:\n\n R0 ");
for (i = 0; i < 8; i++)
{
- ADD_MEM (regs[i], 8);
+ ADD_MEM (regs[i], REG_HEX_SIZE);
ADD_STRING (" ");
}
ADD_STRING ("\n R8 ");
for (i = 8; i < 16; i++)
{
- ADD_MEM (regs[i], 8);
+ ADD_MEM (regs[i], REG_HEX_SIZE);
ADD_STRING (" ");
}
ADD_STRING ("\n R16 ");
for (i = 16; i < 24; i++)
{
- ADD_MEM (regs[i], 8);
+ ADD_MEM (regs[i], REG_HEX_SIZE);
ADD_STRING (" ");
}
ADD_STRING ("\n R24 ");
for (i = 24; i < 32; i++)
{
- ADD_MEM (regs[i], 8);
+ ADD_MEM (regs[i], REG_HEX_SIZE);
ADD_STRING (" ");
}
ADD_STRING ("\n pc lo hi\n ");
for (i = 32; i < 35; i++)
{
- ADD_MEM (regs[i], 8);
+ ADD_MEM (regs[i], REG_HEX_SIZE);
ADD_STRING (" ");
}
ADD_STRING ("\n");
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/sigcontextinfo.h b/libc/ports/sysdeps/unix/sysv/linux/mips/sigcontextinfo.h
index 9edde2168..7793e2147 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/mips/sigcontextinfo.h
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/sigcontextinfo.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2001, 2003, 2004 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.
@@ -23,9 +23,9 @@
#define SIGCONTEXT unsigned long _code, struct sigcontext *
#define SIGCONTEXT_EXTRA_ARGS _code,
-#define GET_PC(ctx) ((void *) ctx->sc_pc)
-#define GET_FRAME(ctx) ((void *) ctx->sc_regs[30])
-#define GET_STACK(ctx) ((void *) ctx->sc_regs[29])
+#define GET_PC(ctx) ((void *) (unsigned long) ctx->sc_pc)
+#define GET_FRAME(ctx) ((void *) (unsigned long) ctx->sc_regs[30])
+#define GET_STACK(ctx) ((void *) (unsigned long) ctx->sc_regs[29])
#define CALL_SIGHANDLER(handler, signo, ctx) \
(handler)((signo), SIGCONTEXT_EXTRA_ARGS (ctx))
@@ -33,9 +33,9 @@
#define SIGCONTEXT unsigned long _code, ucontext_t *
#define SIGCONTEXT_EXTRA_ARGS _code,
-#define GET_PC(ctx) ((void *) ctx->uc_mcontext.pc)
-#define GET_FRAME(ctx) ((void *) ctx->uc_mcontext.gregs[30])
-#define GET_STACK(ctx) ((void *) ctx->uc_mcontext.gregs[29])
+#define GET_PC(ctx) ((void *) (unsigned long) ctx->uc_mcontext.pc)
+#define GET_FRAME(ctx) ((void *) (unsigned long) ctx->uc_mcontext.gregs[30])
+#define GET_STACK(ctx) ((void *) (unsigned long) ctx->uc_mcontext.gregs[29])
#define CALL_SIGHANDLER(handler, signo, ctx) \
(handler)((signo), SIGCONTEXT_EXTRA_ARGS (ctx))
diff --git a/libc/posix/bits/posix1_lim.h b/libc/posix/bits/posix1_lim.h
index 5800ef50e..e7587edce 100644
--- a/libc/posix/bits/posix1_lim.h
+++ b/libc/posix/bits/posix1_lim.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-1993,96,98,2000-2003,2004 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
@@ -134,7 +134,11 @@
#define _POSIX_TTY_NAME_MAX 9
/* Maximum length of a timezone name (element of `tzname'). */
-#define _POSIX_TZNAME_MAX 6
+#ifdef __USE_XOPEN2K
+# define _POSIX_TZNAME_MAX 6
+#else
+# define _POSIX_TZNAME_MAX 3
+#endif
#if !defined __USE_XOPEN2K || defined __USE_GNU
/* Maximum number of connections that can be queued on a socket. */
diff --git a/libc/resolv/nss_dns/dns-host.c b/libc/resolv/nss_dns/dns-host.c
index 6b62c0588..f78b87990 100644
--- a/libc/resolv/nss_dns/dns-host.c
+++ b/libc/resolv/nss_dns/dns-host.c
@@ -199,6 +199,11 @@ _nss_dns_gethostbyname3_r (const char *name, int af, struct hostent *result,
status = NSS_STATUS_TRYAGAIN;
h_errno = TRY_AGAIN;
break;
+ /* System has run out of file descriptors. */
+ case EMFILE:
+ case ENFILE:
+ h_errno = NETDB_INTERNAL;
+ /* Fall through. */
case ECONNREFUSED:
case ETIMEDOUT:
status = NSS_STATUS_UNAVAIL;
@@ -311,14 +316,26 @@ _nss_dns_gethostbyname4_r (const char *name, struct gaih_addrtuple **pat,
&ans2p, &nans2p, &resplen2);
if (n < 0)
{
- if (errno == ESRCH)
+ switch (errno)
{
+ case ESRCH:
status = NSS_STATUS_TRYAGAIN;
h_errno = TRY_AGAIN;
+ break;
+ /* System has run out of file descriptors. */
+ case EMFILE:
+ case ENFILE:
+ h_errno = NETDB_INTERNAL;
+ /* Fall through. */
+ case ECONNREFUSED:
+ case ETIMEDOUT:
+ status = NSS_STATUS_UNAVAIL;
+ break;
+ default:
+ status = NSS_STATUS_NOTFOUND;
+ break;
}
- else
- status = (errno == ECONNREFUSED
- ? NSS_STATUS_UNAVAIL : NSS_STATUS_NOTFOUND);
+
*herrnop = h_errno;
if (h_errno == TRY_AGAIN)
*errnop = EAGAIN;
diff --git a/libc/resolv/res_query.c b/libc/resolv/res_query.c
index abccd4a92..1325f9772 100644
--- a/libc/resolv/res_query.c
+++ b/libc/resolv/res_query.c
@@ -122,6 +122,7 @@ __libc_res_nquery(res_state statp,
int *resplen2)
{
HEADER *hp = (HEADER *) answer;
+ HEADER *hp2;
int n, use_malloc = 0;
u_int oflags = statp->_flags;
@@ -239,26 +240,25 @@ __libc_res_nquery(res_state statp,
/* __libc_res_nsend might have reallocated the buffer. */
hp = (HEADER *) *answerp;
- /* We simplify the following tests by assigning HP to HP2. It
- is easy to verify that this is the same as ignoring all
- tests of HP2. */
- HEADER *hp2 = answerp2 ? (HEADER *) *answerp2 : hp;
-
- if (n < (int) sizeof (HEADER) && answerp2 != NULL
- && *resplen2 > (int) sizeof (HEADER))
+ /* We simplify the following tests by assigning HP to HP2 or
+ vice versa. It is easy to verify that this is the same as
+ ignoring all tests of HP or HP2. */
+ if (answerp2 == NULL || *resplen2 < (int) sizeof (HEADER))
{
- /* Special case of partial answer. */
- assert (hp != hp2);
- hp = hp2;
+ hp2 = hp;
}
- else if (answerp2 != NULL && *resplen2 < (int) sizeof (HEADER)
- && n > (int) sizeof (HEADER))
+ else
{
- /* Special case of partial answer. */
- assert (hp != hp2);
- hp2 = hp;
+ hp2 = (HEADER *) *answerp2;
+ if (n < (int) sizeof (HEADER))
+ {
+ hp = hp2;
+ }
}
+ /* Make sure both hp and hp2 are defined */
+ assert((hp != NULL) && (hp2 != NULL));
+
if ((hp->rcode != NOERROR || ntohs(hp->ancount) == 0)
&& (hp2->rcode != NOERROR || ntohs(hp2->ancount) == 0)) {
#ifdef DEBUG
diff --git a/libc/resolv/res_send.c b/libc/resolv/res_send.c
index 0a28cd784..c790031b4 100644
--- a/libc/resolv/res_send.c
+++ b/libc/resolv/res_send.c
@@ -1129,7 +1129,7 @@ send_dg(res_state statp,
reqs[1].msg_hdr.msg_control = NULL;
reqs[1].msg_hdr.msg_controllen = 0;
- int ndg = sendmmsg (pfd[0].fd, reqs, 2, MSG_NOSIGNAL);
+ int ndg = __sendmmsg (pfd[0].fd, reqs, 2, MSG_NOSIGNAL);
if (__builtin_expect (ndg == 2, 1))
{
if (reqs[0].msg_len != buflen
diff --git a/libc/scripts/abilist.awk b/libc/scripts/abilist.awk
index 1c1d41d05..6d58f6663 100644
--- a/libc/scripts/abilist.awk
+++ b/libc/scripts/abilist.awk
@@ -81,7 +81,7 @@ $2 == "g" || $2 == "w" && (NF == 7 || NF == 8) {
type = "F";
size = "";
}
- else if (type == "iD" && $4 == ".text") {
+ else if (type == "iD" && ($4 == ".text" || $4 == ".opd")) {
# Indirect functions.
type = "F";
size = "";
diff --git a/libc/signal/signal.h b/libc/signal/signal.h
index a6a0590e4..36720d457 100644
--- a/libc/signal/signal.h
+++ b/libc/signal/signal.h
@@ -73,7 +73,9 @@ typedef __uid_t uid_t;
/* We need `struct timespec' later on. */
# define __need_timespec
# include <time.h>
+#endif
+#if defined __USE_POSIX199309 || defined __USE_XOPEN_EXTENDED
/* Get the `siginfo_t' type plus the needed symbols. */
# include <bits/siginfo.h>
#endif
diff --git a/libc/socket/Makefile b/libc/socket/Makefile
index e3a90b8a3..6037f3ff0 100644
--- a/libc/socket/Makefile
+++ b/libc/socket/Makefile
@@ -26,7 +26,7 @@ headers := sys/socket.h sys/un.h bits/sockaddr.h bits/socket.h \
routines := accept bind connect getpeername getsockname getsockopt \
listen recv recvfrom recvmsg send sendmsg sendto \
setsockopt shutdown socket socketpair isfdtype opensock \
- sockatmark accept4
+ sockatmark accept4 recvmmsg sendmmsg
aux := have_sock_cloexec
diff --git a/libc/socket/Versions b/libc/socket/Versions
index 7a96b1e93..dcad32988 100644
--- a/libc/socket/Versions
+++ b/libc/socket/Versions
@@ -34,4 +34,10 @@ libc {
GLIBC_2.10 {
accept4;
}
+ GLIBC_2.17 {
+ recvmmsg; sendmmsg;
+ }
+ GLIBC_PRIVATE {
+ __sendmmsg;
+ }
}
diff --git a/libc/socket/recvmmsg.c b/libc/socket/recvmmsg.c
new file mode 100644
index 000000000..2d6d47484
--- /dev/null
+++ b/libc/socket/recvmmsg.c
@@ -0,0 +1,31 @@
+/* Receive multiple messages on a socket. Stub version.
+ Copyright (C) 2010-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 <errno.h>
+#include <sys/socket.h>
+
+/* Receive up to VLEN messages as described by VMESSAGES from socket FD.
+ Returns the number of bytes read or -1 for errors. */
+int
+recvmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags,
+ const struct timespec *tmo)
+{
+ __set_errno (ENOSYS);
+ return -1;
+}
+stub_warning (recvmmsg)
diff --git a/libc/socket/sendmmsg.c b/libc/socket/sendmmsg.c
new file mode 100644
index 000000000..ed93f49e9
--- /dev/null
+++ b/libc/socket/sendmmsg.c
@@ -0,0 +1,32 @@
+/* Send multiple messages on a socket. Stub version.
+ 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
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <errno.h>
+#include <sys/socket.h>
+
+/* Send a VLEN messages as described by VMESSAGES to socket FD.
+ Returns the number of datagrams successfully written or -1 for errors. */
+int
+__sendmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags)
+{
+ __set_errno (ENOSYS);
+ return -1;
+}
+libc_hidden_def (__sendmmsg)
+weak_alias (__sendmmsg, sendmmsg)
+stub_warning (sendmmsg)
diff --git a/libc/socket/sys/socket.h b/libc/socket/sys/socket.h
index 787c2b907..3810a3754 100644
--- a/libc/socket/sys/socket.h
+++ b/libc/socket/sys/socket.h
@@ -97,6 +97,16 @@ typedef union { __SOCKADDR_ALLTYPES
# undef __SOCKADDR_ONETYPE
#endif
+#ifdef __USE_GNU
+/* For `recvmmsg' and `sendmmsg'. */
+struct mmsghdr
+ {
+ struct msghdr msg_hdr; /* Actual message header. */
+ unsigned int msg_len; /* Number of received or sent bytes for the
+ entry. */
+ };
+#endif
+
/* Create a new socket of type TYPE in domain DOMAIN, using
protocol PROTOCOL. If PROTOCOL is zero, one is chosen automatically.
@@ -175,6 +185,16 @@ extern ssize_t recvfrom (int __fd, void *__restrict __buf, size_t __n,
extern ssize_t sendmsg (int __fd, const struct msghdr *__message,
int __flags);
+#ifdef __USE_GNU
+/* Send a VLEN messages as described by VMESSAGES to socket FD.
+ Returns 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
+
/* Receive a message as described by MESSAGE from socket FD.
Returns the number of bytes read or -1 for errors.
@@ -182,6 +202,17 @@ extern ssize_t sendmsg (int __fd, const struct msghdr *__message,
__THROW. */
extern ssize_t recvmsg (int __fd, struct msghdr *__message, int __flags);
+#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);
+#endif
+
/* Put the current value for socket FD's option OPTNAME at protocol level LEVEL
into OPTVAL (which is *OPTLEN bytes long), and set *OPTLEN to the value's
diff --git a/libc/stdio-common/_itowa.c b/libc/stdio-common/_itowa.c
index 6561ee158..f50893dfc 100644
--- a/libc/stdio-common/_itowa.c
+++ b/libc/stdio-common/_itowa.c
@@ -159,7 +159,8 @@ _itowa (value, buflim, base, upper_case)
if (brec->flag)
while (value != 0)
{
- mp_limb_t quo, rem, x, dummy;
+ mp_limb_t quo, rem, x;
+ mp_limb_t dummy __attribute__ ((unused));
umul_ppmm (x, dummy, value, base_multiplier);
quo = (x + ((value - x) >> 1)) >> (brec->post_shift - 1);
@@ -170,7 +171,8 @@ _itowa (value, buflim, base, upper_case)
else
while (value != 0)
{
- mp_limb_t quo, rem, x, dummy;
+ mp_limb_t quo, rem, x;
+ mp_limb_t dummy __attribute__ ((unused));
umul_ppmm (x, dummy, value, base_multiplier);
quo = x >> brec->post_shift;
diff --git a/libc/sunrpc/bindrsvprt.c b/libc/sunrpc/bindrsvprt.c
index d493c9f23..e6a1b0b0b 100644
--- a/libc/sunrpc/bindrsvprt.c
+++ b/libc/sunrpc/bindrsvprt.c
@@ -35,6 +35,12 @@
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
+#include <bits/libc-lock.h>
+
+/*
+ * Locks the static variables in this file.
+ */
+__libc_lock_define_initialized (static, lock);
/*
* Bind a socket to a privileged IP port
@@ -74,6 +80,9 @@ bindresvport (int sd, struct sockaddr_in *sin)
int nports = ENDPORT - startport + 1;
int endport = ENDPORT;
+
+ __libc_lock_lock (lock);
+
again:
for (i = 0; i < nports; ++i)
{
@@ -94,6 +103,8 @@ bindresvport (int sd, struct sockaddr_in *sin)
goto again;
}
+ __libc_lock_unlock (lock);
+
return res;
}
libc_hidden_def (bindresvport)
diff --git a/libc/sunrpc/rpc/svc.h b/libc/sunrpc/rpc/svc.h
index 54d1ac14f..ae6d9ac20 100644
--- a/libc/sunrpc/rpc/svc.h
+++ b/libc/sunrpc/rpc/svc.h
@@ -1,6 +1,23 @@
/*
* svc.h, Server-side remote procedure call interface.
*
+ * 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/>.
+ *
* Copyright (c) 2010, Oracle America, Inc.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/libc/sunrpc/svc.c b/libc/sunrpc/svc.c
index 103770a42..736d4a974 100644
--- a/libc/sunrpc/svc.c
+++ b/libc/sunrpc/svc.c
@@ -4,6 +4,23 @@
* There are two sets of procedures here. The xprt routines are
* for handling transport handles. The svc routines handle the
* list of service routines.
+ * Copyright (C) 2002-2012 Free Software Foundation, Inc.
+ * This file is part of the GNU C Library.
+ * Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
+ *
+ * The GNU C Library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * The GNU C Library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with the GNU C Library; if not, see
+ * <http://www.gnu.org/licenses/>.
*
* Copyright (c) 2010, Oracle America, Inc.
*
@@ -41,6 +58,7 @@
#include <rpc/svc.h>
#include <rpc/pmap_clnt.h>
#include <sys/poll.h>
+#include <time.h>
#ifdef _RPC_THREAD_SAFE_
#define xports RPC_THREAD_VARIABLE(svc_xports_s)
@@ -544,6 +562,21 @@ svc_getreq_common (const int fd)
}
libc_hidden_nolink_sunrpc (svc_getreq_common, GLIBC_2_2)
+/* If there are no file descriptors available, then accept will fail.
+ We want to delay here so the connection request can be dequeued;
+ otherwise we can bounce between polling and accepting, never giving the
+ request a chance to dequeue and eating an enormous amount of cpu time
+ in svc_run if we're polling on many file descriptors. */
+void
+__svc_accept_failed (void)
+{
+ if (errno == EMFILE)
+ {
+ struct timespec ts = { .tv_sec = 0, .tv_nsec = 50000000 };
+ __nanosleep (&ts, NULL);
+ }
+}
+
#ifdef _RPC_THREAD_SAFE_
void
diff --git a/libc/sunrpc/svc_tcp.c b/libc/sunrpc/svc_tcp.c
index eb615494d..1fdb0ad2d 100644
--- a/libc/sunrpc/svc_tcp.c
+++ b/libc/sunrpc/svc_tcp.c
@@ -1,6 +1,23 @@
/*
* svc_tcp.c, Server side for TCP/IP based RPC.
*
+ * 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/>.
+ *
* Copyright (c) 2010, Oracle America, Inc.
*
* Redistribution and use in source and binary forms, with or without
@@ -247,6 +264,7 @@ again:
{
if (errno == EINTR)
goto again;
+ __svc_accept_failed ();
return FALSE;
}
/*
diff --git a/libc/sunrpc/svc_udp.c b/libc/sunrpc/svc_udp.c
index 6c4d75a81..3324e2a13 100644
--- a/libc/sunrpc/svc_udp.c
+++ b/libc/sunrpc/svc_udp.c
@@ -3,6 +3,23 @@
* Server side for UDP/IP based RPC. (Does some caching in the hopes of
* achieving execute-at-most-once semantics.)
*
+ * 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/>.
+ *
* Copyright (c) 2010, Oracle America, Inc.
*
* Redistribution and use in source and binary forms, with or without
@@ -277,8 +294,12 @@ again:
(int) su->su_iosz, 0,
(struct sockaddr *) &(xprt->xp_raddr), &len);
xprt->xp_addrlen = len;
- if (rlen == -1 && errno == EINTR)
- goto again;
+ if (rlen == -1)
+ {
+ if (errno == EINTR)
+ goto again;
+ __svc_accept_failed ();
+ }
if (rlen < 16) /* < 4 32-bit ints? */
return FALSE;
xdrs->x_op = XDR_DECODE;
diff --git a/libc/sunrpc/svc_unix.c b/libc/sunrpc/svc_unix.c
index 94507b240..5c3184a5f 100644
--- a/libc/sunrpc/svc_unix.c
+++ b/libc/sunrpc/svc_unix.c
@@ -1,6 +1,23 @@
/*
* svc_unix.c, Server side for TCP/IP based RPC.
*
+ * 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/>.
+ *
* Copyright (c) 2010, Oracle America, Inc.
*
* Redistribution and use in source and binary forms, with or without
@@ -244,6 +261,7 @@ again:
{
if (errno == EINTR)
goto again;
+ __svc_accept_failed ();
return FALSE;
}
/*
diff --git a/libc/sysdeps/generic/ldconfig.h b/libc/sysdeps/generic/ldconfig.h
index ef3f4b99c..43cb9bdb0 100644
--- a/libc/sysdeps/generic/ldconfig.h
+++ b/libc/sysdeps/generic/ldconfig.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999,2000,2002,2003,2007,2012 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.
@@ -34,6 +34,8 @@
#define FLAG_MIPS64_LIBN32 0x0600
#define FLAG_MIPS64_LIBN64 0x0700
#define FLAG_X8664_LIBX32 0x0800
+#define FLAG_ARM_LIBHF 0x0900
+#define FLAG_AARCH64_LIB64 0x0a00
/* Name of auxiliary cache. */
#define _PATH_LDCONFIG_AUX_CACHE "/var/cache/ldconfig/aux-cache"
diff --git a/libc/sysdeps/generic/unwind-dw2-fde-glibc.c b/libc/sysdeps/generic/unwind-dw2-fde-glibc.c
index 356428cec..25f4c7393 100644
--- a/libc/sysdeps/generic/unwind-dw2-fde-glibc.c
+++ b/libc/sysdeps/generic/unwind-dw2-fde-glibc.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001, 2002, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2012 Free Software Foundation, Inc.
Contributed by Jakub Jelinek <jakub@redhat.com>.
This file is part of the GNU C Library.
@@ -85,7 +85,8 @@ static int
_Unwind_IteratePhdrCallback (struct dl_phdr_info *info, size_t size, void *ptr)
{
struct unw_eh_callback_data *data = (struct unw_eh_callback_data *) ptr;
- const ElfW(Phdr) *phdr, *p_eh_frame_hdr, *p_dynamic;
+ const ElfW(Phdr) *phdr, *p_eh_frame_hdr;
+ const ElfW(Phdr) *p_dynamic __attribute__ ((unused));
long n, match;
_Unwind_Ptr load_base;
const unsigned char *p;
diff --git a/libc/sysdeps/generic/unwind-dw2-fde.c b/libc/sysdeps/generic/unwind-dw2-fde.c
index d47f2b19c..6dcca1d36 100644
--- a/libc/sysdeps/generic/unwind-dw2-fde.c
+++ b/libc/sysdeps/generic/unwind-dw2-fde.c
@@ -1,6 +1,5 @@
/* Subroutines needed for unwinding stack frames for exception handling. */
-/* Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2006, 2007
- Free Software Foundation, Inc.
+/* Copyright (C) 1997-2012 Free Software Foundation, Inc.
Contributed by Jason Merrill <jason@cygnus.com>.
This file is part of the GNU C Library.
@@ -342,14 +341,24 @@ get_fde_encoding (struct dwarf_fde *f)
(Ideally we would have the linker sort the FDEs so we don't have to do
it at run time. But the linkers are not yet prepared for this.) */
+/* Return the Nth pc_begin value from FDE x. */
+
+static inline _Unwind_Ptr
+get_pc_begin (fde *x, size_t n)
+{
+ _Unwind_Ptr p;
+ memcpy (&p, x->pc_begin + n * sizeof (_Unwind_Ptr), sizeof (_Unwind_Ptr));
+ return p;
+}
+
/* Comparison routines. Three variants of increasing complexity. */
static int
fde_unencoded_compare (struct object *ob __attribute__((unused)),
fde *x, fde *y)
{
- _Unwind_Ptr x_ptr = *(_Unwind_Ptr *) x->pc_begin;
- _Unwind_Ptr y_ptr = *(_Unwind_Ptr *) y->pc_begin;
+ _Unwind_Ptr x_ptr = get_pc_begin (x, 0);
+ _Unwind_Ptr y_ptr = get_pc_begin (y, 0);
if (x_ptr > y_ptr)
return 1;
@@ -712,7 +721,7 @@ add_fdes (struct object *ob, struct fde_accumulator *accu, fde *this_fde)
if (encoding == DW_EH_PE_absptr)
{
- if (*(_Unwind_Ptr *) this_fde->pc_begin == 0)
+ if (get_pc_begin (this_fde, 0) == 0)
continue;
}
else
@@ -830,8 +839,8 @@ linear_search_fdes (struct object *ob, fde *this_fde, void *pc)
if (encoding == DW_EH_PE_absptr)
{
- pc_begin = ((_Unwind_Ptr *) this_fde->pc_begin)[0];
- pc_range = ((_Unwind_Ptr *) this_fde->pc_begin)[1];
+ pc_begin = get_pc_begin (this_fde, 0);
+ pc_range = get_pc_begin (this_fde, 1);
if (pc_begin == 0)
continue;
}
@@ -881,8 +890,8 @@ binary_search_unencoded_fdes (struct object *ob, void *pc)
void *pc_begin;
uaddr pc_range;
- pc_begin = ((void **) f->pc_begin)[0];
- pc_range = ((uaddr *) f->pc_begin)[1];
+ pc_begin = (void *) get_pc_begin (f, 0);
+ pc_range = (uaddr) get_pc_begin (f, 1);
if (pc < pc_begin)
hi = i;
diff --git a/libc/sysdeps/i386/fpu/e_powl.S b/libc/sysdeps/i386/fpu/e_powl.S
index ac4842cf6..7e297756f 100644
--- a/libc/sysdeps/i386/fpu/e_powl.S
+++ b/libc/sysdeps/i386/fpu/e_powl.S
@@ -26,9 +26,9 @@
.type one,@object
one: .double 1.0
ASM_SIZE_DIRECTIVE(one)
- .type limit,@object
-limit: .double 0.29
- ASM_SIZE_DIRECTIVE(limit)
+ .type p3,@object
+p3: .byte 0, 0, 0, 0, 0, 0, 0x20, 0x40
+ ASM_SIZE_DIRECTIVE(p3)
.type p63,@object
p63: .byte 0, 0, 0, 0, 0, 0, 0xe0, 0x43
ASM_SIZE_DIRECTIVE(p63)
@@ -141,7 +141,15 @@ ENTRY(__ieee754_powl)
fchs // -0x1p-79 : x
jmp 3f
-9: /* OK, we have an integer value for y. */
+9: /* OK, we have an integer value for y. Unless very small
+ (we use < 8), use the algorithm for real exponent to avoid
+ accumulation of errors. */
+ fld %st // y : y : x
+ fabs // |y| : y : x
+ fcompl MO(p3) // y : x
+ fnstsw
+ sahf
+ jnc 2f
popl %eax
cfi_adjust_cfa_offset (-4)
popl %edx
@@ -182,7 +190,7 @@ ENTRY(__ieee754_powl)
cfi_adjust_cfa_offset (8)
.align ALIGNARG(4)
-2: // y is a large integer (absolute value at least 1L<<63), but
+2: // y is a large integer (absolute value at least 8), but
// may be odd unless at least 1L<<64. So it may be necessary
// to adjust the sign of a negative result afterwards.
fxch // x : y
@@ -205,34 +213,21 @@ ENTRY(__ieee754_powl)
fchs // -(1L<<78) : |x|
.align ALIGNARG(4)
3: /* y is a real number. */
- fxch // x : y
- fldl MO(one) // 1.0 : x : y
- fldl MO(limit) // 0.29 : 1.0 : x : y
- fld %st(2) // x : 0.29 : 1.0 : x : y
- fsub %st(2) // x-1 : 0.29 : 1.0 : x : y
- fabs // |x-1| : 0.29 : 1.0 : x : y
- fucompp // 1.0 : x : y
- fnstsw
- fxch // x : 1.0 : y
- sahf
- ja 7f
- fsub %st(1) // x-1 : 1.0 : y
- fyl2xp1 // log2(x) : y
- jmp 8f
-
-7: fyl2x // log2(x) : y
-8: fmul %st(1) // y*log2(x) : y
- fst %st(1) // y*log2(x) : y*log2(x)
- frndint // int(y*log2(x)) : y*log2(x)
- fsubr %st, %st(1) // int(y*log2(x)) : fract(y*log2(x))
- fxch // fract(y*log2(x)) : int(y*log2(x))
- f2xm1 // 2^fract(y*log2(x))-1 : int(y*log2(x))
- faddl MO(one) // 2^fract(y*log2(x)) : int(y*log2(x))
- fscale // 2^fract(y*log2(x))*2^int(y*log2(x)) : int(y*log2(x))
- fstp %st(1) // 2^fract(y*log2(x))*2^int(y*log2(x))
+ subl $28, %esp
+ cfi_adjust_cfa_offset (28)
+ fstpt 12(%esp) // x
+ fstpt (%esp) // <empty>
+ mov %edx, 24(%esp)
+ call HIDDEN_JUMPTARGET (__powl_helper) // <result>
+ mov 24(%esp), %edx
+ addl $28, %esp
+ cfi_adjust_cfa_offset (-28)
testb $2, %dh
jz 292f
// x is negative. If y is an odd integer, negate the result.
+#ifdef PIC
+ LOAD_PIC_REG (cx)
+#endif
fldt 24(%esp) // y : abs(result)
fld %st // y : y : abs(result)
fabs // |y| : y : abs(result)
diff --git a/libc/sysdeps/i386/fpu/libm-test-ulps b/libc/sysdeps/i386/fpu/libm-test-ulps
index 239da44a7..5b595bc56 100644
--- a/libc/sysdeps/i386/fpu/libm-test-ulps
+++ b/libc/sysdeps/i386/fpu/libm-test-ulps
@@ -1339,6 +1339,9 @@ idouble: 1
ifloat: 1
# cos
+Test "cos (0x1p+50) == 8.68095904660550604334592502063501320395739e-01":
+float: 1
+ifloat: 1
Test "cos (M_PI_6l * 2.0) == 0.5":
double: 1
float: 1
@@ -1817,10 +1820,10 @@ ldouble: 1
# ctan
Test "Real part of: ctan (-2 - 3 i) == 0.376402564150424829275122113032269084e-2 - 1.00323862735360980144635859782192726 i":
-float: 1
-ifloat: 1
double: 1
+float: 1
idouble: 1
+ifloat: 1
ildouble: 1
ldouble: 1
Test "Imaginary part of: ctan (-2 - 3 i) == 0.376402564150424829275122113032269084e-2 - 1.00323862735360980144635859782192726 i":
@@ -2477,6 +2480,11 @@ ifloat: 1
ildouble: 1
ldouble: 1
+# pow
+Test "pow (0x0.ffffffp0, -0x1p24) == 2.7182819094701610539628664526874952929416":
+ildouble: 1
+ldouble: 1
+
# pow_downward
Test "pow_downward (1.0625, 1.125) == 1.070582293028761362162622578677070098674":
double: 1
@@ -2683,6 +2691,9 @@ Test "sincos (0x1.fffff8p+127, &sin_res, &cos_res) puts 4.8578606313048733970111
float: 1
Test "sincos (0x1p+127, &sin_res, &cos_res) puts 6.23385512955870240370428801097126489001833e-01 in sin_res":
float: 1
+Test "sincos (0x1p+50, &sin_res, &cos_res) puts 8.68095904660550604334592502063501320395739e-01 in cos_res":
+float: 1
+ifloat: 1
Test "sincos (0x1p65, &sin_res, &cos_res) puts -0.047183876212354673805106149805700013943218 in sin_res":
float: 1
ifloat: 1
@@ -3015,6 +3026,28 @@ ldouble: 1
Test "y0 (0x1.ff00000000002p+840) == 1.846591691699331493194965158699937660696e-127":
double: 1
idouble: 1
+Test "y0 (0x1p-10) == -4.4865150767109739412411806297168793661098":
+ildouble: 1
+ldouble: 1
+Test "y0 (0x1p-30) == -1.3311940304267782826037118027401817264906e+1":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "y0 (0x1p-40) == -1.7724652307320814696990854700366226762563e+1":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "y0 (0x1p-60) == -2.6550076313426878432849115782108205929120e+1":
+double: 1
+idouble: 1
+Test "y0 (0x1p-70) == -3.0962788316479910300778244424468159753887e+1":
+double: 1
+idouble: 1
+Test "y0 (0x1p-80) == -3.5375500319532942168707373066828113573541e+1":
+double: 1
+idouble: 1
Test "y0 (1.0) == 0.0882569642156769579829267660235151628":
double: 2
float: 1
@@ -3056,6 +3089,9 @@ idouble: 1
ifloat: 2
ildouble: 1
ldouble: 1
+Test "y1 (0x1p-10) == -6.5190099301063115047395187618929589514382e+02":
+float: 1
+ifloat: 1
Test "y1 (1.0) == -0.781212821300288716547150000047964821":
double: 1
idouble: 1
@@ -3562,10 +3598,10 @@ ildouble: 1
ldouble: 1
Function: Real part of "ctan_towardzero":
-float: 1
-ifloat: 1
double: 1
+float: 1
idouble: 1
+ifloat: 1
ildouble: 1
ldouble: 1
@@ -3636,10 +3672,10 @@ ildouble: 4
ldouble: 4
Function: Imaginary part of "ctanh_towardzero":
-float: 1
-ifloat: 1
double: 1
+float: 1
idouble: 1
+ifloat: 1
ildouble: 1
ldouble: 1
@@ -3751,6 +3787,10 @@ ifloat: 1
ildouble: 1
ldouble: 1
+Function: "pow":
+ildouble: 1
+ldouble: 1
+
Function: "pow_downward":
double: 1
float: 1
diff --git a/libc/sysdeps/ieee754/flt-32/e_j0f.c b/libc/sysdeps/ieee754/flt-32/e_j0f.c
index 0729cd04e..c4cabd584 100644
--- a/libc/sysdeps/ieee754/flt-32/e_j0f.c
+++ b/libc/sysdeps/ieee754/flt-32/e_j0f.c
@@ -138,7 +138,7 @@ __ieee754_y0f(float x)
}
return z;
}
- if(ix<=0x32000000) { /* x < 2**-27 */
+ if(ix<=0x39800000) { /* x < 2**-13 */
return(u00 + tpi*__ieee754_logf(x));
}
z = x*x;
diff --git a/libc/sysdeps/ieee754/flt-32/e_j1f.c b/libc/sysdeps/ieee754/flt-32/e_j1f.c
index 30b7d8e25..cb9f97fa2 100644
--- a/libc/sysdeps/ieee754/flt-32/e_j1f.c
+++ b/libc/sysdeps/ieee754/flt-32/e_j1f.c
@@ -133,7 +133,7 @@ __ieee754_y1f(float x)
}
return z;
}
- if(__builtin_expect(ix<=0x24800000, 0)) { /* x < 2**-54 */
+ if(__builtin_expect(ix<=0x33000000, 0)) { /* x < 2**-25 */
return(-tpi/x);
}
z = x*x;
diff --git a/libc/sysdeps/ieee754/ldbl-128/e_j0l.c b/libc/sysdeps/ieee754/ldbl-128/e_j0l.c
index 112a8f3f9..1b1828958 100644
--- a/libc/sysdeps/ieee754/ldbl-128/e_j0l.c
+++ b/libc/sysdeps/ieee754/ldbl-128/e_j0l.c
@@ -809,6 +809,7 @@ static long double Y0_2D[NY0_2D + 1] = {
/* 1.000000000000000000000000000000000000000E0 */
};
+static const long double U0 = -7.3804295108687225274343927948483016310862e-02L;
/* Bessel function of the second kind, order zero. */
@@ -831,6 +832,8 @@ long double
return -HUGE_VALL + x;
}
xx = fabsl (x);
+ if (xx <= 0x1p-57)
+ return U0 + TWOOPI * __ieee754_logl (x);
if (xx <= 2.0L)
{
/* 0 <= x <= 2 */
diff --git a/libc/sysdeps/ieee754/ldbl-128/e_j1l.c b/libc/sysdeps/ieee754/ldbl-128/e_j1l.c
index 1f62bd092..f16343b26 100644
--- a/libc/sysdeps/ieee754/ldbl-128/e_j1l.c
+++ b/libc/sysdeps/ieee754/ldbl-128/e_j1l.c
@@ -838,6 +838,8 @@ __ieee754_y1l (long double x)
return -HUGE_VALL + x;
}
xx = fabsl (x);
+ if (xx <= 0x1p-114)
+ return -TWOOPI / x;
if (xx <= 2.0L)
{
/* 0 <= x <= 2 */
diff --git a/libc/sysdeps/ieee754/ldbl-128/e_powl.c b/libc/sysdeps/ieee754/ldbl-128/e_powl.c
index 40fc31473..d13175071 100644
--- a/libc/sysdeps/ieee754/ldbl-128/e_powl.c
+++ b/libc/sysdeps/ieee754/ldbl-128/e_powl.c
@@ -149,7 +149,7 @@ __ieee754_powl (long double x, long double y)
{
long double z, ax, z_h, z_l, p_h, p_l;
long double y1, t1, t2, r, s, t, u, v, w;
- long double s2, s_h, s_l, t_h, t_l;
+ long double s2, s_h, s_l, t_h, t_l, ay;
int32_t i, j, k, yisint, n;
u_int32_t ix, iy;
int32_t hx, hy;
@@ -282,6 +282,10 @@ __ieee754_powl (long double x, long double y)
return (hy > 0) ? huge * huge : tiny * tiny;
}
+ ay = y > 0 ? y : -y;
+ if (ay < 0x1p-128)
+ y = y < 0 ? -0x1p-128 : 0x1p-128;
+
n = 0;
/* take care subnormal number */
if (ix < 0x00010000)
diff --git a/libc/sysdeps/ieee754/ldbl-128/s_atanl.c b/libc/sysdeps/ieee754/ldbl-128/s_atanl.c
index 0138e792a..adac0a79e 100644
--- a/libc/sysdeps/ieee754/ldbl-128/s_atanl.c
+++ b/libc/sysdeps/ieee754/ldbl-128/s_atanl.c
@@ -167,6 +167,7 @@ static const long double
q4 = 2.173623741810414221251136181221172551416E1L;
/* q5 = 1.000000000000000000000000000000000000000E0 */
+static const long double huge = 1.0e4930L;
long double
__atanl (long double x)
@@ -197,6 +198,22 @@ __atanl (long double x)
return atantbl[83];
}
+ if (k <= 0x3fc50000) /* |x| < 2**-58 */
+ {
+ /* Raise inexact. */
+ if (huge + x > 0.0)
+ return x;
+ }
+
+ if (k >= 0x40720000) /* |x| > 2**115 */
+ {
+ /* Saturate result to {-,+}pi/2 */
+ if (sign)
+ return -atantbl[83];
+ else
+ return atantbl[83];
+ }
+
if (sign)
x = -x;
diff --git a/libc/sysdeps/ieee754/ldbl-128/s_nearbyintl.c b/libc/sysdeps/ieee754/ldbl-128/s_nearbyintl.c
index b335adcaa..d2afc10a5 100644
--- a/libc/sysdeps/ieee754/ldbl-128/s_nearbyintl.c
+++ b/libc/sysdeps/ieee754/ldbl-128/s_nearbyintl.c
@@ -37,7 +37,7 @@ long double __nearbyintl(long double x)
{
fenv_t env;
int64_t i0,j0,sx;
- u_int64_t i1;
+ u_int64_t i1 __attribute__ ((unused));
long double w,t;
GET_LDOUBLE_WORDS64(i0,i1,x);
sx = (((u_int64_t)i0)>>63);
diff --git a/libc/sysdeps/ieee754/ldbl-128/s_rintl.c b/libc/sysdeps/ieee754/ldbl-128/s_rintl.c
index 088d3c4d5..ae2142b2c 100644
--- a/libc/sysdeps/ieee754/ldbl-128/s_rintl.c
+++ b/libc/sysdeps/ieee754/ldbl-128/s_rintl.c
@@ -39,7 +39,7 @@ TWO112[2]={
long double __rintl(long double x)
{
int64_t i0,j0,sx;
- u_int64_t i1;
+ u_int64_t i1 __attribute__ ((unused));
long double w,t;
GET_LDOUBLE_WORDS64(i0,i1,x);
sx = (((u_int64_t)i0)>>63);
diff --git a/libc/sysdeps/ieee754/ldbl-128ibm/e_hypotl.c b/libc/sysdeps/ieee754/ldbl-128ibm/e_hypotl.c
index 00bfb1592..768bd3b06 100644
--- a/libc/sysdeps/ieee754/ldbl-128ibm/e_hypotl.c
+++ b/libc/sysdeps/ieee754/ldbl-128ibm/e_hypotl.c
@@ -61,7 +61,7 @@ __ieee754_hypotl(long double x, long double y)
if(hb > ha) {a=y;b=x;j=ha; ha=hb;hb=j;} else {a=x;b=y;}
a = fabsl(a); /* a <- |a| */
b = fabsl(b); /* b <- |b| */
- if((ha-hb)>0x3c0000000000000LL) {return a+b;} /* x/y > 2**60 */
+ if((ha-hb)>0x780000000000000LL) {return a+b;} /* x/y > 2**120 */
k=0;
kld = 1.0L;
if(ha > 0x5f30000000000000LL) { /* a>2**500 */
@@ -83,7 +83,7 @@ __ieee754_hypotl(long double x, long double y)
k += 600;
kld = two600;
}
- if(hb < 0x20b0000000000000LL) { /* b < 2**-500 */
+ if(hb < 0x23d0000000000000LL) { /* b < 2**-450 */
if(hb <= 0x000fffffffffffffLL) { /* subnormal b or 0 */
u_int64_t low;
GET_LDOUBLE_LSW64(low,b);
diff --git a/libc/sysdeps/ieee754/ldbl-128ibm/e_powl.c b/libc/sysdeps/ieee754/ldbl-128ibm/e_powl.c
index 0fd4820e4..8216c4906 100644
--- a/libc/sysdeps/ieee754/ldbl-128ibm/e_powl.c
+++ b/libc/sysdeps/ieee754/ldbl-128ibm/e_powl.c
@@ -149,7 +149,7 @@ __ieee754_powl (long double x, long double y)
{
long double z, ax, z_h, z_l, p_h, p_l;
long double y1, t1, t2, r, s, t, u, v, w;
- long double s2, s_h, s_l, t_h, t_l;
+ long double s2, s_h, s_l, t_h, t_l, ay;
int32_t i, j, k, yisint, n;
u_int32_t ix, iy;
int32_t hx, hy;
@@ -284,6 +284,10 @@ __ieee754_powl (long double x, long double y)
return (hy > 0) ? huge * huge : tiny * tiny;
}
+ ay = y > 0 ? y : -y;
+ if (ay < 0x1p-117)
+ y = y < 0 ? -0x1p-117 : 0x1p-117;
+
n = 0;
/* take care subnormal number */
if (ix < 0x00100000)
diff --git a/libc/sysdeps/ieee754/ldbl-128ibm/s_atanl.c b/libc/sysdeps/ieee754/ldbl-128ibm/s_atanl.c
index 779209d3d..2a36d16bb 100644
--- a/libc/sysdeps/ieee754/ldbl-128ibm/s_atanl.c
+++ b/libc/sysdeps/ieee754/ldbl-128ibm/s_atanl.c
@@ -199,6 +199,22 @@ __atanl (long double x)
return atantbl[83];
}
+ if (k <= 0x3c800000) /* |x| <= 2**-55. */
+ {
+ /* Raise inexact. */
+ if (1e300L + x > 0.0)
+ return x;
+ }
+
+ if (k >= 0x46c00000) /* |x| >= 2**109. */
+ {
+ /* Saturate result to {-,+}pi/2. */
+ if (sign)
+ return -atantbl[83];
+ else
+ return atantbl[83];
+ }
+
if (sign)
x = -x;
diff --git a/libc/sysdeps/ieee754/ldbl-128ibm/s_expm1l.c b/libc/sysdeps/ieee754/ldbl-128ibm/s_expm1l.c
index 98ae4e1ce..8808dcd89 100644
--- a/libc/sysdeps/ieee754/ldbl-128ibm/s_expm1l.c
+++ b/libc/sysdeps/ieee754/ldbl-128ibm/s_expm1l.c
@@ -85,7 +85,7 @@ static const long double
/* ln (2^16384 * (1 - 2^-113)) */
maxlog = 1.1356523406294143949491931077970764891253E4L,
/* ln 2^-114 */
- minarg = -7.9018778583833765273564461846232128760607E1L, big = 2e307L;
+ minarg = -7.9018778583833765273564461846232128760607E1L, big = 1e290L;
long double
diff --git a/libc/sysdeps/ieee754/ldbl-128ibm/s_fmal.c b/libc/sysdeps/ieee754/ldbl-128ibm/s_fmal.c
index a868b8d51..6706eb20e 100644
--- a/libc/sysdeps/ieee754/ldbl-128ibm/s_fmal.c
+++ b/libc/sysdeps/ieee754/ldbl-128ibm/s_fmal.c
@@ -1,5 +1,5 @@
/* Compute x * y + z as ternary operation.
- 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 David Flaherty <flaherty@linux.vnet.ibm.com>.
@@ -29,6 +29,12 @@ __fmal (long double x, long double y, long double z)
if ((finite ((double)x) && finite ((double)y)) && isinf ((double)z))
return (z);
+ /* If z is zero and x are y are nonzero, compute the result
+ as x * y to avoid the wrong sign of a zero result if x * y
+ underflows to 0. */
+ if (z == 0 && x != 0 && y != 0)
+ return x * y;
+
return (x * y) + z;
}
#ifdef IS_IN_libm
diff --git a/libc/sysdeps/ieee754/ldbl-96/e_asinl.c b/libc/sysdeps/ieee754/ldbl-96/e_asinl.c
index c33701f11..c1ffa3e0d 100644
--- a/libc/sysdeps/ieee754/ldbl-96/e_asinl.c
+++ b/libc/sysdeps/ieee754/ldbl-96/e_asinl.c
@@ -64,9 +64,12 @@
static const long double
one = 1.0L,
huge = 1.0e+4932L,
- pio2_hi = 1.5707963267948966192021943710788178805159986950457096099853515625L,
- pio2_lo = 2.9127320560933561582586004641843300502121E-20L,
- pio4_hi = 7.8539816339744830960109718553940894025800E-1L,
+ pio2_hi = 0x1.921fb54442d1846ap+0L, /* pi/2 rounded to nearest to 64
+ bits. */
+ pio2_lo = -0x7.6733ae8fe47c65d8p-68L, /* pi/2 - pio2_hi rounded to
+ nearest to 64 bits. */
+ pio4_hi = 0xc.90fdaa22168c235p-4L, /* pi/4 rounded to nearest to 64
+ bits. */
/* coefficient for R(x^2) */
diff --git a/libc/sysdeps/mach/hurd/ptsname.c b/libc/sysdeps/mach/hurd/ptsname.c
index 1a32311fd..c7b52ff7a 100644
--- a/libc/sysdeps/mach/hurd/ptsname.c
+++ b/libc/sysdeps/mach/hurd/ptsname.c
@@ -1,5 +1,5 @@
/* ptsname -- return the name of a pty slave given an FD to the pty master
- Copyright (C) 1999 Free Software Foundation, Inc.
+ Copyright (C) 1999-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
@@ -29,12 +29,10 @@
char *
ptsname (int fd)
{
- static char peername[1024]; /* XXX */
+ static string_t peername;
error_t err;
err = __ptsname_r (fd, peername, sizeof (peername));
- if (err)
- __set_errno (err);
return err ? NULL : peername;
}
@@ -46,17 +44,19 @@ ptsname (int fd)
int
__ptsname_r (int fd, char *buf, size_t buflen)
{
- char peername[1024]; /* XXX */
+ string_t peername;
size_t len;
error_t err;
- peername[0] = '\0';
if (err = HURD_DPORT_USE (fd, __term_get_peername (port, peername)))
- return _hurd_fd_error (fd, err);
+ return __hurd_dfail (fd, err), errno;
- len = strlen (peername) + 1;
+ len = __strnlen (peername, sizeof peername - 1) + 1;
if (len > buflen)
- return ERANGE;
+ {
+ errno = ERANGE;
+ return ERANGE;
+ }
memcpy (buf, peername, len);
return 0;
diff --git a/libc/ports/sysdeps/unix/sysv/linux/ia64/clock_getcpuclockid.c b/libc/sysdeps/mach/hurd/syncfs.c
index 1289d1f74..fc4ff4760 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/ia64/clock_getcpuclockid.c
+++ b/libc/sysdeps/mach/hurd/syncfs.c
@@ -1,5 +1,6 @@
-/* clock_getcpuclockid -- Get a clockid_t for process CPU time. Linux/IA64
- Copyright (C) 2000,2001,2003,2004 Free Software Foundation, Inc.
+/* Make all changes done to all files on the file system associated
+ with FD actually appear on disk.
+ 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
@@ -16,16 +17,15 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <errno.h>
-#include <time.h>
#include <unistd.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <fcntl.h>
-
-
-#include "has_cpuclock.c"
-
-#define HAS_CPUCLOCK (has_cpuclock () > 0)
-
-#include <sysdeps/unix/sysv/linux/clock_getcpuclockid.c>
+#include <hurd.h>
+#include <hurd/fd.h>
+
+int
+syncfs (int fd)
+{
+ error_t err = HURD_DPORT_USE (fd, __file_syncfs (port, 1, 0));
+ if (err)
+ return __hurd_dfail (fd, err);
+ return 0;
+}
diff --git a/libc/sysdeps/posix/getaddrinfo.c b/libc/sysdeps/posix/getaddrinfo.c
index 3cc244b7f..d95c2d115 100644
--- a/libc/sysdeps/posix/getaddrinfo.c
+++ b/libc/sysdeps/posix/getaddrinfo.c
@@ -1049,6 +1049,12 @@ gaih_inet (const char *name, const struct gaih_service *service,
_res.options |= old_res_options & RES_USE_INET6;
+ if (status == NSS_STATUS_UNAVAIL)
+ {
+ result = GAIH_OKIFUNSPEC | -EAI_SYSTEM;
+ goto free_and_return;
+ }
+
if (no_data != 0 && no_inet6_data != 0)
{
/* If both requests timed out report this. */
diff --git a/libc/sysdeps/powerpc/fpu/libm-test-ulps b/libc/sysdeps/powerpc/fpu/libm-test-ulps
index b37806582..9c21f6e66 100644
--- a/libc/sysdeps/powerpc/fpu/libm-test-ulps
+++ b/libc/sysdeps/powerpc/fpu/libm-test-ulps
@@ -136,6 +136,9 @@ ldouble: 1
Test "atan2 (-0.75, -1.0) == -2.49809154479650885165983415456218025":
float: 1
ifloat: 1
+Test "atan2 (-max_value, -min_value) == -pi/2":
+float: 1
+ifloat: 1
Test "atan2 (0.75, -1.0) == 2.49809154479650885165983415456218025":
float: 1
ifloat: 1
@@ -2725,6 +2728,38 @@ double: 1
idouble: 1
ildouble: 1
ldouble: 1
+Test "y0 (0x1p-100) == -4.420092432563900590456563035154802121284e+1":
+ildouble: 1
+ldouble: 1
+Test "y0 (0x1p-110) == -4.861363632869203777249475899390797503250e+1":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "y0 (0x1p-20) == -8.8992283012125827603076426611387876938160":
+double: 1
+idouble: 1
+Test "y0 (0x1p-30) == -1.3311940304267782826037118027401817264906e+1":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "y0 (0x1p-40) == -1.7724652307320814696990854700366226762563e+1":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "y0 (0x1p-60) == -2.6550076313426878432849115782108205929120e+1":
+float: 1
+ifloat: 1
+Test "y0 (0x1p-70) == -3.0962788316479910300778244424468159753887e+1":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "y0 (0x1p-80) == -3.5375500319532942168707373066828113573541e+1":
+double: 1
+idouble: 1
Test "y0 (1.0) == 0.0882569642156769579829267660235151628":
double: 2
float: 1
@@ -2769,6 +2804,12 @@ idouble: 1
ifloat: 1
ildouble: 1
ldouble: 1
+Test "y1 (0x1p-10) == -6.5190099301063115047395187618929589514382e+02":
+double: 1
+idouble: 1
+Test "y1 (0x1p-20) == -6.6754421443450423911167962313100637952285e+05":
+ildouble: 1
+ldouble: 1
Test "y1 (1.5) == -0.412308626973911295952829820633445323":
float: 1
ifloat: 1
diff --git a/libc/sysdeps/powerpc/powerpc64/entry.h b/libc/sysdeps/powerpc/powerpc64/entry.h
index 2a54fe728..b1d4b7f1a 100644
--- a/libc/sysdeps/powerpc/powerpc64/entry.h
+++ b/libc/sysdeps/powerpc/powerpc64/entry.h
@@ -1,5 +1,5 @@
/* Finding the entry point and start of text. PowerPC64 version.
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002-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
@@ -30,4 +30,6 @@ extern void _start (void);
to keep profiling records. We can't copy the ia64 scheme as our
entry poiny address is really the address of the function
descriptor, not the actual function entry. */
-#define TEXT_START (((long int *) ENTRY_POINT)[0])
+#define TEXT_START \
+ ({ extern unsigned long int _start_as_data[] asm ("_start"); \
+ _start_as_data[0]; })
diff --git a/libc/sysdeps/sh/dl-machine.h b/libc/sysdeps/sh/dl-machine.h
index 53656aff9..1bb5d156c 100644
--- a/libc/sysdeps/sh/dl-machine.h
+++ b/libc/sysdeps/sh/dl-machine.h
@@ -1,6 +1,5 @@
/* Machine-dependent ELF dynamic relocation inline functions. SH version.
- Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2011
- Free Software Foundation, Inc.
+ Copyright (C) 1999-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
@@ -116,6 +115,7 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
}
#define ELF_MACHINE_RUNTIME_FIXUP_ARGS int plt_type
+#define ELF_MACHINE_RUNTIME_FIXUP_PARAMS plt_type
/* Mask identifying addresses reserved for the user program,
where the dynamic linker should not map anything. */
diff --git a/libc/sysdeps/sparc/fpu/libm-test-ulps b/libc/sysdeps/sparc/fpu/libm-test-ulps
index 0f8179f6b..d6ad5c55c 100644
--- a/libc/sysdeps/sparc/fpu/libm-test-ulps
+++ b/libc/sysdeps/sparc/fpu/libm-test-ulps
@@ -102,6 +102,9 @@ float: 1
ifloat: 1
ildouble: 1
ldouble: 1
+Test "atan2 (-max_value, -min_value) == -pi/2":
+float: 1
+ifloat: 1
Test "atan2 (0.75, -1.0) == 2.49809154479650885165983415456218025":
float: 1
ifloat: 1
@@ -1328,8 +1331,8 @@ Test "Imaginary part of: clog10 (0xf2p-10 + 0x3e3p-10 i) == 2.692124017335111295
double: 1
idouble: 1
Test "Imaginary part of: clog10 (0xfd95243681c055c2632286921092p-113 + 0x1bccabcd29ca2152860ec29e34ef7p-113 i) == 2.8774482675253468630312378575186855052697e-66 + 0.4571561610046221605554903008571429975493 i":
-ldouble: 2
ildouble: 2
+ldouble: 2
Test "Imaginary part of: clog10 (0xfe961079616p-45 + 0x1bc37e09e6d1p-45 i) == 2.3329549194675052736016290082882121135546e-26 + 0.4561756099441139182878993697611751382976 i":
double: 1
idouble: 1
@@ -2543,15 +2546,38 @@ ildouble: 1
ldouble: 1
# pow
+Test "pow (0x0.fffffffffffff8p0, -0x1.23456789abcdfp62) == 9.8826311568054561811190162420900667121992e+252":
+ildouble: 1
+ldouble: 1
Test "pow (0x0.ffffffp0, -0x1p24) == 2.7182819094701610539628664526874952929416":
float: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
Test "pow (0x0.ffffffp0, 0x1p24) == 0.3678794302077803437135155590023422899744":
float: 1
ifloat: 1
Test "pow (0x1.000002p0, 0x1p24) == 7.3890552180866447284268641248075832310141":
float: 1
ifloat: 1
+Test "pow (10.0, -4930.0) == 1e-4930":
+ildouble: 1
+ldouble: 1
+Test "pow (10.0, 4929.0) == 1e4929":
+ildouble: 1
+ldouble: 1
+Test "pow (10.0, 4930.0) == 1e4930":
+ildouble: 1
+ldouble: 1
+Test "pow (10.0, 4931.0) == 1e4931":
+ildouble: 1
+ldouble: 1
+Test "pow (10.0, 4932.0) == 1e4932":
+ildouble: 1
+ldouble: 1
+Test "pow (1e4932, 0.75) == 1e3699":
+ildouble: 1
+ldouble: 1
# pow_downward
Test "pow_downward (1.5, 1.03125) == 1.519127098714743184071644334163037684948":
@@ -2861,6 +2887,43 @@ double: 1
idouble: 1
ildouble: 1
ldouble: 1
+Test "y0 (0x1p-10) == -4.4865150767109739412411806297168793661098":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "y0 (0x1p-110) == -4.861363632869203777249475899390797503250e+1":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "y0 (0x1p-20) == -8.8992283012125827603076426611387876938160":
+float: 1
+ifloat: 1
+Test "y0 (0x1p-30) == -1.3311940304267782826037118027401817264906e+1":
+float: 1
+ifloat: 1
+ildouble: 2
+ldouble: 2
+Test "y0 (0x1p-40) == -1.7724652307320814696990854700366226762563e+1":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "y0 (0x1p-50) == -2.2137364310373846564919987139743760738155e+1":
+float: 1
+ifloat: 1
+Test "y0 (0x1p-60) == -2.6550076313426878432849115782108205929120e+1":
+ildouble: 1
+ldouble: 1
+Test "y0 (0x1p-70) == -3.0962788316479910300778244424468159753887e+1":
+double: 1
+idouble: 1
+Test "y0 (0x1p-80) == -3.5375500319532942168707373066828113573541e+1":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
Test "y0 (1.0) == 0.0882569642156769579829267660235151628":
double: 2
float: 1
@@ -2897,6 +2960,14 @@ ldouble: 1
Test "y1 (0x1.27e204p+99) == -8.881610148467797208469612080785210013461e-16":
double: 1
idouble: 1
+Test "y1 (0x1p-10) == -6.5190099301063115047395187618929589514382e+02":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "y1 (0x1p-30) == -6.8356527557643159612937462812258975438856e+08":
+ildouble: 1
+ldouble: 1
Test "y1 (1.5) == -0.412308626973911295952829820633445323":
float: 1
ifloat: 1
@@ -3595,6 +3666,8 @@ ldouble: 1
Function: "pow":
float: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
Function: "pow_downward":
float: 1
diff --git a/libc/sysdeps/unix/make-syscalls.sh b/libc/sysdeps/unix/make-syscalls.sh
index 7e7de65f3..f7162e218 100644
--- a/libc/sysdeps/unix/make-syscalls.sh
+++ b/libc/sysdeps/unix/make-syscalls.sh
@@ -4,8 +4,19 @@
# Expects $sysdirs in environment.
##############################################################################
-
-# Syscall Signature Key Letters for BP Thunks:
+#
+# This script is used to process the syscall data encoded in the various
+# syscalls.list files to produce thin assembly syscall wrappers around the
+# appropriate OS syscall. See syscall-template.s for more details on the
+# actual wrapper.
+#
+# Syscall Signature Prefixes:
+#
+# C: cancellable (i.e., this syscall is a cancellation point)
+# E: errno and return value are not set by the call
+# V: errno is not set, but errno or zero (success) is returned from the call
+#
+# Syscall Signature Key Letters:
#
# a: unchecked address (e.g., 1st arg to mmap)
# b: non-NULL buffer (e.g., 2nd arg to read; return value from mmap)
@@ -23,6 +34,7 @@
# v: vararg scalar (e.g., optional 3rd arg to open)
# V: byte-per-page vector (3rd arg to mincore)
# W: wait status, optionally-NULL pointer to int (e.g., 2nd arg of wait4)
+#
ptr='[abBfFINpPsSWV]' # all pointer keyletters
int='[inv]' # all scalar keyletters
diff --git a/libc/sysdeps/unix/sysv/linux/Makefile b/libc/sysdeps/unix/sysv/linux/Makefile
index 8e5361c49..ecd9c2c97 100644
--- a/libc/sysdeps/unix/sysv/linux/Makefile
+++ b/libc/sysdeps/unix/sysv/linux/Makefile
@@ -12,8 +12,7 @@ CFLAGS-malloc.c += -DMORECORE_CLEARS=2
endif
ifeq ($(subdir),socket)
-sysdep_routines += internal_accept4 recvmmsg internal_recvmmsg sendmmsg \
- internal_sendmmsg
+sysdep_routines += internal_accept4 internal_recvmmsg internal_sendmmsg
endif
ifeq ($(subdir),misc)
diff --git a/libc/sysdeps/unix/sysv/linux/bits/socket.h b/libc/sysdeps/unix/sysv/linux/bits/socket.h
index 309cba728..df8f1670b 100644
--- a/libc/sysdeps/unix/sysv/linux/bits/socket.h
+++ b/libc/sysdeps/unix/sysv/linux/bits/socket.h
@@ -235,16 +235,6 @@ struct msghdr
int msg_flags; /* Flags on received message. */
};
-#ifdef __USE_GNU
-/* For `recvmmsg' and 'sendmmsg'. */
-struct mmsghdr
- {
- struct msghdr msg_hdr; /* Actual message header. */
- unsigned int msg_len; /* Number of received or sent bytes
- for the entry. */
- };
-#endif
-
/* Structure used for storage of ancillary data object information. */
struct cmsghdr
{
@@ -389,27 +379,4 @@ struct linger
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/libc/sysdeps/unix/sysv/linux/clock_getcpuclockid.c b/libc/sysdeps/unix/sysv/linux/clock_getcpuclockid.c
index c00f5ea06..c734c5a04 100644
--- a/libc/sysdeps/unix/sysv/linux/clock_getcpuclockid.c
+++ b/libc/sysdeps/unix/sysv/linux/clock_getcpuclockid.c
@@ -22,10 +22,6 @@
#include <kernel-features.h>
#include "kernel-posix-cpu-timers.h"
-#ifndef HAS_CPUCLOCK
-# define HAS_CPUCLOCK 1
-#endif
-
int
clock_getcpuclockid (pid_t pid, clockid_t *clock_id)
{
diff --git a/libc/sysdeps/unix/sysv/linux/internal_sendmmsg.S b/libc/sysdeps/unix/sysv/linux/internal_sendmmsg.S
index f5152c9f1..e6681f099 100644
--- a/libc/sysdeps/unix/sysv/linux/internal_sendmmsg.S
+++ b/libc/sysdeps/unix/sysv/linux/internal_sendmmsg.S
@@ -2,13 +2,14 @@
#include <sys/syscall.h>
#if !defined __NR_sendmmsg && defined __NR_socketcall
# define socket sendmmsg
-# ifdef __ASSUME_SENDMMSG
-# define __socket sendmmsg
-# else
+# ifndef __ASSUME_SENDMMSG
# define __socket __internal_sendmmsg
+# define NO_WEAK_ALIAS
# endif
# define NARGS 4
# define NEED_CANCELLATION
-# define NO_WEAK_ALIAS
# include <socket.S>
+# ifdef __ASSUME_SENDMMSG
+libc_hidden_def (__sendmmsg)
+# endif
#endif
diff --git a/libc/sysdeps/unix/sysv/linux/recvmmsg.c b/libc/sysdeps/unix/sysv/linux/recvmmsg.c
index 32fc8dfc6..009d868a6 100644
--- a/libc/sysdeps/unix/sysv/linux/recvmmsg.c
+++ b/libc/sysdeps/unix/sysv/linux/recvmmsg.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010 Free Software Foundation, Inc.
+/* Copyright (C) 2010-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Schwab <schwab@redhat.com>, 2010.
@@ -88,12 +88,5 @@ recvmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags,
/* When __ASSUME_RECVMMSG recvmmsg is defined in internal_recvmmsg.S. */
# endif
#else
-int
-recvmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags,
- const struct timespec *tmo)
-{
- __set_errno (ENOSYS);
- return -1;
-}
-stub_warning (recvmmsg)
+# include <socket/recvmmsg.c>
#endif
diff --git a/libc/sysdeps/unix/sysv/linux/sendmmsg.c b/libc/sysdeps/unix/sysv/linux/sendmmsg.c
index 067441920..a6daff172 100644
--- a/libc/sysdeps/unix/sysv/linux/sendmmsg.c
+++ b/libc/sysdeps/unix/sysv/linux/sendmmsg.c
@@ -1,4 +1,4 @@
-/* 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.
@@ -26,7 +26,7 @@
#ifdef __NR_sendmmsg
int
-sendmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags)
+__sendmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags)
{
if (SINGLE_THREAD_P)
return INLINE_SYSCALL (sendmmsg, 4, fd, vmessages, vlen, flags);
@@ -39,6 +39,8 @@ sendmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags)
return result;
}
+libc_hidden_def (__sendmmsg)
+weak_alias (__sendmmsg, sendmmsg)
#elif defined __NR_socketcall
# ifndef __ASSUME_SENDMMSG
extern int __internal_sendmmsg (int fd, struct mmsghdr *vmessages,
@@ -48,7 +50,7 @@ extern int __internal_sendmmsg (int fd, struct mmsghdr *vmessages,
static int have_sendmmsg;
int
-sendmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags)
+__sendmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags)
{
if (__builtin_expect (have_sendmmsg >= 0, 1))
{
@@ -81,15 +83,11 @@ sendmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags)
__set_errno (ENOSYS);
return -1;
}
+libc_hidden_def (__sendmmsg)
+weak_alias (__sendmmsg, sendmmsg)
# else
/* When __ASSUME_SENDMMSG sendmmsg is defined in internal_sendmmsg.S. */
# endif
#else
-int
-sendmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags)
-{
- __set_errno (ENOSYS);
- return -1;
-}
-stub_warning (sendmmsg)
+# include <socket/sendmmsg.c>
#endif
diff --git a/libc/sysdeps/unix/sysv/linux/sys/sysctl.h b/libc/sysdeps/unix/sysv/linux/sys/sysctl.h
index 8b58905e7..cfa71ad27 100644
--- a/libc/sysdeps/unix/sysv/linux/sys/sysctl.h
+++ b/libc/sysdeps/unix/sysv/linux/sys/sysctl.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2012 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1999, 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -39,14 +39,6 @@
# define __user
# define __undef__LINUX_COMPILER_H
#endif
-#ifndef _UAPI_LINUX_KERNEL_H
-# define _UAPI_LINUX_KERNEL_H
-# define __undef_UAPI_LINUX_KERNEL_H
-#endif
-#ifndef _UAPI_LINUX_TYPES_H
-# define _UAPI_LINUX_TYPES_H
-# define __undef_UAPI_LINUX_TYPES_H
-#endif
#include <linux/sysctl.h>
@@ -67,14 +59,6 @@
# undef __user
# undef __undef__LINUX_COMPILER_H
#endif
-#ifdef __undef_UAPI_LINUX_KERNEL_H
-# undef _UAPI_LINUX_KERNEL_H
-# undef __undef_UAPI_LINUX_KERNEL_H
-#endif
-#ifdef __undef_UAPI_LINUX_TYPES_H
-# undef _UAPI_LINUX_TYPES_H
-# undef __undef_UAPI_LINUX_TYPES_H
-#endif
#include <bits/sysctl.h>
diff --git a/libc/sysdeps/x86/fpu/Makefile b/libc/sysdeps/x86/fpu/Makefile
new file mode 100644
index 000000000..805438047
--- /dev/null
+++ b/libc/sysdeps/x86/fpu/Makefile
@@ -0,0 +1,3 @@
+ifeq ($(subdir),math)
+libm-support += powl_helper
+endif
diff --git a/libc/sysdeps/x86/fpu/powl_helper.c b/libc/sysdeps/x86/fpu/powl_helper.c
new file mode 100644
index 000000000..3f69b08a1
--- /dev/null
+++ b/libc/sysdeps/x86/fpu/powl_helper.c
@@ -0,0 +1,211 @@
+/* Implement powl for x86 using extra-precision log.
+ 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 <math.h>
+#include <math_private.h>
+
+/* High parts and low parts of -log (k/16), for integer k from 12 to
+ 24. */
+
+static const long double powl_log_table[] =
+ {
+ 0x4.9a58844d36e49e1p-4L, -0x1.0522624fd558f574p-68L,
+ 0x3.527da7915b3c6de4p-4L, 0x1.7d4ef4b901b99b9ep-68L,
+ 0x2.22f1d044fc8f7bc8p-4L, -0x1.8e97c071a42fc388p-68L,
+ 0x1.08598b59e3a0688ap-4L, 0x3.fd9bf503372c12fcp-72L,
+ -0x0p+0L, 0x0p+0L,
+ -0xf.85186008b15330cp-8L, 0x1.9b47488a6687672cp-72L,
+ -0x1.e27076e2af2e5e9ep-4L, -0xa.87ffe1fe9e155dcp-72L,
+ -0x2.bfe60e14f27a791p-4L, 0x1.83bebf1bdb88a032p-68L,
+ -0x3.91fef8f353443584p-4L, -0xb.b03de5ff734495cp-72L,
+ -0x4.59d72aeae98380e8p-4L, 0xc.e0aa3be4747dc1p-72L,
+ -0x5.1862f08717b09f4p-4L, -0x2.decdeccf1cd10578p-68L,
+ -0x5.ce75fdaef401a738p-4L, -0x9.314feb4fbde5aaep-72L,
+ -0x6.7cc8fb2fe612fcbp-4L, 0x2.5ca2642feb779f98p-68L,
+ };
+
+/* High 32 bits of log2 (e), and remainder rounded to 64 bits. */
+static const long double log2e_hi = 0x1.71547652p+0L;
+static const long double log2e_lo = 0xb.82fe1777d0ffda1p-36L;
+
+/* Given a number with high part HI and low part LO, add the number X
+ to it and store the result in *RHI and *RLO. It is given that
+ either |X| < |0.7 * HI|, or HI == LO == 0, and that the values are
+ small enough that no overflow occurs. The result does not need to
+ be exact to 128 bits; 78-bit accuracy of the final accumulated
+ result suffices. */
+
+static inline void
+acc_split (long double *rhi, long double *rlo, long double hi, long double lo,
+ long double x)
+{
+ long double thi = hi + x;
+ long double tlo = (hi - thi) + x + lo;
+ *rhi = thi + tlo;
+ *rlo = (thi - *rhi) + tlo;
+}
+
+extern long double __powl_helper (long double x, long double y);
+libm_hidden_proto (__powl_helper)
+
+/* Given X a value that is finite and nonzero, or a NaN, and only
+ negative if Y is not an integer, and Y a finite nonzero value with
+ 0x1p-79 <= |Y| <= 0x1p78, compute X to the power Y. */
+
+long double
+__powl_helper (long double x, long double y)
+{
+ if (isnan (x) || x < 0)
+ return __ieee754_expl (y * __ieee754_logl (x));
+
+ /* We need to compute Y * log2 (X) to at least 64 bits after the
+ point for normal results (that is, to at least 78 bits
+ precision). */
+ int x_int_exponent;
+ long double x_frac;
+ x_frac = __frexpl (x, &x_int_exponent);
+ if (x_frac <= 0x0.aaaaaaaaaaaaaaaap0L) /* 2.0L / 3.0L, rounded down */
+ {
+ x_frac *= 2.0;
+ x_int_exponent--;
+ }
+
+ long double log_x_frac_hi, log_x_frac_lo;
+ /* Determine an initial approximation to log (X_FRAC) using
+ POWL_LOG_TABLE, and multiply by a value K/16 to reduce to an
+ interval (24/25, 26/25). */
+ int k = (int) ((16.0L / x_frac) + 0.5L);
+ log_x_frac_hi = powl_log_table[2 * k - 24];
+ log_x_frac_lo = powl_log_table[2 * k - 23];
+ long double x_frac_low;
+ if (k == 16)
+ x_frac_low = 0.0L;
+ else
+ {
+ /* Mask off low 5 bits of X_FRAC so the multiplication by K/16
+ is exact. These bits are small enough that they can be
+ corrected for by adding log2 (e) * X_FRAC_LOW to the final
+ result. */
+ int32_t se;
+ u_int32_t i0, i1;
+ GET_LDOUBLE_WORDS (se, i0, i1, x_frac);
+ x_frac_low = x_frac;
+ i1 &= 0xffffffe0;
+ SET_LDOUBLE_WORDS (x_frac, se, i0, i1);
+ x_frac_low -= x_frac;
+ x_frac_low /= x_frac;
+ x_frac *= k / 16.0L;
+ }
+
+ /* Now compute log (X_FRAC) for X_FRAC in (24/25, 26/25). Separate
+ W = X_FRAC - 1 into high 16 bits and remaining bits, so that
+ multiplications for low-order power series terms are exact. The
+ remaining bits are small enough that adding a 64-bit value of
+ log2 (1 + W_LO / (1 + W_HI)) will be a sufficient correction for
+ them. */
+ long double w = x_frac - 1;
+ long double w_hi, w_lo;
+ int32_t se;
+ u_int32_t i0, i1;
+ GET_LDOUBLE_WORDS (se, i0, i1, w);
+ i0 &= 0xffff0000;
+ i1 = 0;
+ SET_LDOUBLE_WORDS (w_hi, se, i0, i1);
+ w_lo = w - w_hi;
+ long double wp = w_hi;
+ acc_split (&log_x_frac_hi, &log_x_frac_lo, log_x_frac_hi, log_x_frac_lo, wp);
+ wp *= -w_hi;
+ acc_split (&log_x_frac_hi, &log_x_frac_lo, log_x_frac_hi, log_x_frac_lo,
+ wp / 2.0L);
+ wp *= -w_hi;
+ acc_split (&log_x_frac_hi, &log_x_frac_lo, log_x_frac_hi, log_x_frac_lo,
+ wp * 0x0.5555p0L); /* -W_HI**3 / 3, high part. */
+ acc_split (&log_x_frac_hi, &log_x_frac_lo, log_x_frac_hi, log_x_frac_lo,
+ wp * 0x0.5555555555555555p-16L); /* -W_HI**3 / 3, low part. */
+ wp *= -w_hi;
+ acc_split (&log_x_frac_hi, &log_x_frac_lo, log_x_frac_hi, log_x_frac_lo,
+ wp / 4.0L);
+ /* Subsequent terms are small enough that they only need be computed
+ to 64 bits. */
+ for (int i = 5; i <= 17; i++)
+ {
+ wp *= -w_hi;
+ acc_split (&log_x_frac_hi, &log_x_frac_lo, log_x_frac_hi, log_x_frac_lo,
+ wp / i);
+ }
+
+ /* Convert LOG_X_FRAC_HI + LOG_X_FRAC_LO to a base-2 logarithm. */
+ long double log2_x_frac_hi, log2_x_frac_lo;
+ long double log_x_frac_hi32, log_x_frac_lo64;
+ GET_LDOUBLE_WORDS (se, i0, i1, log_x_frac_hi);
+ i1 = 0;
+ SET_LDOUBLE_WORDS (log_x_frac_hi32, se, i0, i1);
+ log_x_frac_lo64 = (log_x_frac_hi - log_x_frac_hi32) + log_x_frac_lo;
+ long double log2_x_frac_hi1 = log_x_frac_hi32 * log2e_hi;
+ long double log2_x_frac_lo1
+ = log_x_frac_lo64 * log2e_hi + log_x_frac_hi * log2e_lo;
+ log2_x_frac_hi = log2_x_frac_hi1 + log2_x_frac_lo1;
+ log2_x_frac_lo = (log2_x_frac_hi1 - log2_x_frac_hi) + log2_x_frac_lo1;
+
+ /* Correct for the masking off of W_LO. */
+ long double log2_1p_w_lo;
+ asm ("fyl2xp1"
+ : "=t" (log2_1p_w_lo)
+ : "0" (w_lo / (1.0L + w_hi)), "u" (1.0L)
+ : "st(1)");
+ acc_split (&log2_x_frac_hi, &log2_x_frac_lo, log2_x_frac_hi, log2_x_frac_lo,
+ log2_1p_w_lo);
+
+ /* Correct for the masking off of X_FRAC_LOW. */
+ acc_split (&log2_x_frac_hi, &log2_x_frac_lo, log2_x_frac_hi, log2_x_frac_lo,
+ x_frac_low * M_LOG2El);
+
+ /* Add the integer and fractional parts of the base-2 logarithm. */
+ long double log2_x_hi, log2_x_lo;
+ log2_x_hi = x_int_exponent + log2_x_frac_hi;
+ log2_x_lo = ((x_int_exponent - log2_x_hi) + log2_x_frac_hi) + log2_x_frac_lo;
+
+ /* Compute the base-2 logarithm of the result. */
+ long double log2_res_hi, log2_res_lo;
+ long double log2_x_hi32, log2_x_lo64;
+ GET_LDOUBLE_WORDS (se, i0, i1, log2_x_hi);
+ i1 = 0;
+ SET_LDOUBLE_WORDS (log2_x_hi32, se, i0, i1);
+ log2_x_lo64 = (log2_x_hi - log2_x_hi32) + log2_x_lo;
+ long double y_hi32, y_lo32;
+ GET_LDOUBLE_WORDS (se, i0, i1, y);
+ i1 = 0;
+ SET_LDOUBLE_WORDS (y_hi32, se, i0, i1);
+ y_lo32 = y - y_hi32;
+ log2_res_hi = log2_x_hi32 * y_hi32;
+ log2_res_lo = log2_x_hi32 * y_lo32 + log2_x_lo64 * y;
+
+ /* Split the base-2 logarithm of the result into integer and
+ fractional parts. */
+ long double log2_res_int = __roundl (log2_res_hi);
+ long double log2_res_frac = log2_res_hi - log2_res_int + log2_res_lo;
+
+ /* Compute the final result. */
+ long double res;
+ asm ("f2xm1" : "=t" (res) : "0" (log2_res_frac));
+ res += 1.0L;
+ asm ("fscale" : "=t" (res) : "0" (res), "u" (log2_res_int));
+ return res;
+}
+
+libm_hidden_def (__powl_helper)
diff --git a/libc/sysdeps/x86_64/bits/atomic.h b/libc/sysdeps/x86_64/bits/atomic.h
index 100943fa1..552581c46 100644
--- a/libc/sysdeps/x86_64/bits/atomic.h
+++ b/libc/sysdeps/x86_64/bits/atomic.h
@@ -18,6 +18,7 @@
#include <stdint.h>
#include <tls.h> /* For tcbhead_t. */
+#include <libc-internal.h>
typedef int8_t atomic8_t;
@@ -101,8 +102,9 @@ typedef uintmax_t uatomic_max_t;
"lock\n" \
"0:\tcmpxchgq %q2, %1" \
: "=a" (ret), "=m" (*mem) \
- : "q" ((atomic64_t) (newval)), "m" (*mem), \
- "0" ((atomic64_t) (oldval)), \
+ : "q" ((atomic64_t) cast_to_integer (newval)), \
+ "m" (*mem), \
+ "0" ((atomic64_t) cast_to_integer (oldval)), \
"i" (offsetof (tcbhead_t, multiple_threads))); \
ret; })
@@ -125,7 +127,8 @@ typedef uintmax_t uatomic_max_t;
else \
__asm __volatile ("xchgq %q0, %1" \
: "=r" (result), "=m" (*mem) \
- : "0" ((atomic64_t) (newvalue)), "m" (*mem)); \
+ : "0" ((atomic64_t) cast_to_integer (newvalue)), \
+ "m" (*mem)); \
result; })
@@ -149,7 +152,8 @@ typedef uintmax_t uatomic_max_t;
else \
__asm __volatile (lock "xaddq %q0, %1" \
: "=r" (result), "=m" (*mem) \
- : "0" ((atomic64_t) (value)), "m" (*mem), \
+ : "0" ((atomic64_t) cast_to_integer (value)), \
+ "m" (*mem), \
"i" (offsetof (tcbhead_t, multiple_threads))); \
result; })
@@ -187,7 +191,8 @@ typedef uintmax_t uatomic_max_t;
else \
__asm __volatile (lock "addq %q1, %0" \
: "=m" (*mem) \
- : "ir" ((atomic64_t) (value)), "m" (*mem), \
+ : "ir" ((atomic64_t) cast_to_integer (value)), \
+ "m" (*mem), \
"i" (offsetof (tcbhead_t, multiple_threads))); \
} while (0)
@@ -218,7 +223,8 @@ typedef uintmax_t uatomic_max_t;
else \
__asm __volatile (LOCK_PREFIX "addq %q2, %0; sets %1" \
: "=m" (*mem), "=qm" (__result) \
- : "ir" ((atomic64_t) (value)), "m" (*mem)); \
+ : "ir" ((atomic64_t) cast_to_integer (value)), \
+ "m" (*mem)); \
__result; })
@@ -239,7 +245,8 @@ typedef uintmax_t uatomic_max_t;
else \
__asm __volatile (LOCK_PREFIX "addq %q2, %0; setz %1" \
: "=m" (*mem), "=qm" (__result) \
- : "ir" ((atomic64_t) (value)), "m" (*mem)); \
+ : "ir" ((atomic64_t) cast_to_integer (value)), \
+ "m" (*mem)); \
__result; })
diff --git a/libc/sysdeps/x86_64/fpu/e_powl.S b/libc/sysdeps/x86_64/fpu/e_powl.S
index 1b3718522..ff96cec68 100644
--- a/libc/sysdeps/x86_64/fpu/e_powl.S
+++ b/libc/sysdeps/x86_64/fpu/e_powl.S
@@ -26,9 +26,9 @@
.type one,@object
one: .double 1.0
ASM_SIZE_DIRECTIVE(one)
- .type limit,@object
-limit: .double 0.29
- ASM_SIZE_DIRECTIVE(limit)
+ .type p3,@object
+p3: .byte 0, 0, 0, 0, 0, 0, 0x20, 0x40
+ ASM_SIZE_DIRECTIVE(p3)
.type p63,@object
p63: .byte 0, 0, 0, 0, 0, 0, 0xe0, 0x43
ASM_SIZE_DIRECTIVE(p63)
@@ -131,7 +131,15 @@ ENTRY(__ieee754_powl)
fchs // -0x1p-79 : x
jmp 3f
-9: /* OK, we have an integer value for y. */
+9: /* OK, we have an integer value for y. Unless very small
+ (we use < 8), use the algorithm for real exponent to avoid
+ accumulation of errors. */
+ fldl MO(p3) // 8 : y : x
+ fld %st(1) // y : 8 : y : x
+ fabs // |y| : 8 : y : x
+ fcomip %st(1), %st // 8 : y : x
+ fstp %st(0) // y : x
+ jnc 2f
mov -8(%rsp),%eax
mov -4(%rsp),%edx
orl $0, %edx
@@ -167,7 +175,7 @@ ENTRY(__ieee754_powl)
ret
.align ALIGNARG(4)
-2: // y is a large integer (absolute value at least 1L<<63), but
+2: // y is a large integer (absolute value at least 8), but
// may be odd unless at least 1L<<64. So it may be necessary
// to adjust the sign of a negative result afterwards.
fxch // x : y
@@ -190,31 +198,15 @@ ENTRY(__ieee754_powl)
fchs // -(1L<<78) : |x|
.align ALIGNARG(4)
3: /* y is a real number. */
- fxch // x : y
- fldl MO(one) // 1.0 : x : y
- fldl MO(limit) // 0.29 : 1.0 : x : y
- fld %st(2) // x : 0.29 : 1.0 : x : y
- fsub %st(2) // x-1 : 0.29 : 1.0 : x : y
- fabs // |x-1| : 0.29 : 1.0 : x : y
- fucompp // 1.0 : x : y
- fnstsw
- fxch // x : 1.0 : y
- test $0x4500,%eax
- jz 7f
- fsub %st(1) // x-1 : 1.0 : y
- fyl2xp1 // log2(x) : y
- jmp 8f
-
-7: fyl2x // log2(x) : y
-8: fmul %st(1) // y*log2(x) : y
- fst %st(1) // y*log2(x) : y*log2(x)
- frndint // int(y*log2(x)) : y*log2(x)
- fsubr %st, %st(1) // int(y*log2(x)) : fract(y*log2(x))
- fxch // fract(y*log2(x)) : int(y*log2(x))
- f2xm1 // 2^fract(y*log2(x))-1 : int(y*log2(x))
- faddl MO(one) // 2^fract(y*log2(x)) : int(y*log2(x))
- fscale // 2^fract(y*log2(x))*2^int(y*log2(x)) : int(y*log2(x))
- fstp %st(1) // 2^fract(y*log2(x))*2^int(y*log2(x))
+ subq $40, %rsp
+ cfi_adjust_cfa_offset (40)
+ fstpt 16(%rsp) // x
+ fstpt (%rsp) // <empty>
+ mov %edx, 32(%rsp)
+ call HIDDEN_JUMPTARGET (__powl_helper) // <result>
+ mov 32(%rsp), %edx
+ addq $40, %rsp
+ cfi_adjust_cfa_offset (-40)
testb $2, %dh
jz 292f
// x is negative. If y is an odd integer, negate the result.
diff --git a/libc/sysdeps/x86_64/fpu/libm-test-ulps b/libc/sysdeps/x86_64/fpu/libm-test-ulps
index 9c5157ff7..9e7a8adac 100644
--- a/libc/sysdeps/x86_64/fpu/libm-test-ulps
+++ b/libc/sysdeps/x86_64/fpu/libm-test-ulps
@@ -162,6 +162,9 @@ ldouble: 1
Test "atan2 (-0.75, -1.0) == -2.49809154479650885165983415456218025":
float: 1
ifloat: 1
+Test "atan2 (-max_value, -min_value) == -pi/2":
+float: 1
+ifloat: 1
Test "atan2 (0.75, -1.0) == 2.49809154479650885165983415456218025":
float: 1
ifloat: 1
@@ -2395,6 +2398,8 @@ ifloat: 1
Test "pow (0x0.ffffffp0, -0x1p24) == 2.7182819094701610539628664526874952929416":
float: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
Test "pow (0x0.ffffffp0, 0x1p24) == 0.3678794302077803437135155590023422899744":
float: 1
ifloat: 1
@@ -2796,6 +2801,38 @@ ldouble: 1
Test "y0 (0x1.ff00000000002p+840) == 1.846591691699331493194965158699937660696e-127":
double: 1
idouble: 1
+Test "y0 (0x1p-10) == -4.4865150767109739412411806297168793661098":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "y0 (0x1p-110) == -4.861363632869203777249475899390797503250e+1":
+double: 1
+idouble: 1
+Test "y0 (0x1p-20) == -8.8992283012125827603076426611387876938160":
+float: 1
+ifloat: 1
+Test "y0 (0x1p-30) == -1.3311940304267782826037118027401817264906e+1":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "y0 (0x1p-40) == -1.7724652307320814696990854700366226762563e+1":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "y0 (0x1p-50) == -2.2137364310373846564919987139743760738155e+1":
+float: 1
+ifloat: 1
+Test "y0 (0x1p-70) == -3.0962788316479910300778244424468159753887e+1":
+double: 1
+idouble: 1
+Test "y0 (0x1p-80) == -3.5375500319532942168707373066828113573541e+1":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
Test "y0 (1.0) == 0.0882569642156769579829267660235151628":
double: 2
float: 1
@@ -2837,6 +2874,9 @@ idouble: 1
ifloat: 1
ildouble: 1
ldouble: 1
+Test "y1 (0x1p-10) == -6.5190099301063115047395187618929589514382e+02":
+double: 1
+idouble: 1
Test "y1 (1.5) == -0.412308626973911295952829820633445323":
float: 1
ifloat: 1
@@ -3537,6 +3577,8 @@ ifloat: 1
Function: "pow":
float: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
Function: "pow_downward":
float: 1
diff --git a/libc/sysdeps/x86_64/multiarch/test-multiarch.c b/libc/sysdeps/x86_64/multiarch/test-multiarch.c
index 76b1af2f8..4b91ae36a 100644
--- a/libc/sysdeps/x86_64/multiarch/test-multiarch.c
+++ b/libc/sysdeps/x86_64/multiarch/test-multiarch.c
@@ -36,7 +36,7 @@ get_cpuinfo (void)
f = fopen ("/proc/cpuinfo", "r");
if (f == NULL)
{
- printf ("cannot open /proc/cpuinfo");
+ printf ("cannot open /proc/cpuinfo\n");
exit (1);
}