]> git.ipfire.org Git - thirdparty/glibc.git/commit
Implement C23 log2p1
authorJoseph Myers <josmyers@redhat.com>
Mon, 20 May 2024 13:41:39 +0000 (13:41 +0000)
committerJoseph Myers <josmyers@redhat.com>
Mon, 20 May 2024 13:41:39 +0000 (13:41 +0000)
commit79c52daf4740b00bef43e4f5a4281b3480459b38
treecc15e0f7402870b20dbebf8d539df033806d48b0
parentcf0ca8d52e1653d4aa4311a4649af8dc541ce6b4
Implement C23 log2p1

C23 adds various <math.h> function families originally defined in TS
18661-4.  Add the log2p1 functions (log2(1+x): like log1p, but for
base-2 logarithms).

This illustrates the intended structure of implementations of all
these function families: define them initially with a type-generic
template implementation.  If someone wishes to add type-specific
implementations, it is likely such implementations can be both faster
and more accurate than the type-generic one and can then override it
for types for which they are implemented (adding benchmarks would be
desirable in such cases to demonstrate that a new implementation is
indeed faster).

The test inputs are copied from those for log1p.  Note that these
changes make gen-auto-libm-tests depend on MPFR 4.2 (or later).

The bulk of the changes are fairly generic for any such new function.
(sysdeps/powerpc/nofpu/Makefile only needs changing for those
type-generic templates that use fabs.)

Tested for x86_64 and x86, and with build-many-glibcs.py.
52 files changed:
NEWS
manual/math.texi
math/Makefile
math/Versions
math/auto-libm-test-in
math/auto-libm-test-out-log2p1 [new file with mode: 0644]
math/bits/mathcalls.h
math/gen-auto-libm-tests.c
math/gen-tgmath-tests.py
math/libm-test-log2p1.inc [new file with mode: 0644]
math/s_log2p1_template.c [new file with mode: 0644]
math/test-tgmath.c
math/tgmath.h
sysdeps/i386/i686/fpu/multiarch/libm-test-ulps
sysdeps/ieee754/ldbl-128ibm-compat/Versions
sysdeps/ieee754/ldbl-opt/Makefile
sysdeps/ieee754/ldbl-opt/nldbl-log2p1.c [new file with mode: 0644]
sysdeps/mach/hurd/i386/libm.abilist
sysdeps/mach/hurd/x86_64/libm.abilist
sysdeps/powerpc/nofpu/Makefile
sysdeps/unix/sysv/linux/aarch64/libm.abilist
sysdeps/unix/sysv/linux/alpha/libm.abilist
sysdeps/unix/sysv/linux/arc/libm.abilist
sysdeps/unix/sysv/linux/arm/be/libm.abilist
sysdeps/unix/sysv/linux/arm/le/libm.abilist
sysdeps/unix/sysv/linux/csky/libm.abilist
sysdeps/unix/sysv/linux/hppa/libm.abilist
sysdeps/unix/sysv/linux/i386/libm.abilist
sysdeps/unix/sysv/linux/loongarch/lp64/libm.abilist
sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist
sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist
sysdeps/unix/sysv/linux/microblaze/be/libm.abilist
sysdeps/unix/sysv/linux/microblaze/le/libm.abilist
sysdeps/unix/sysv/linux/mips/mips32/libm.abilist
sysdeps/unix/sysv/linux/mips/mips64/libm.abilist
sysdeps/unix/sysv/linux/nios2/libm.abilist
sysdeps/unix/sysv/linux/or1k/libm.abilist
sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist
sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist
sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libm.abilist
sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libm.abilist
sysdeps/unix/sysv/linux/riscv/rv32/libm.abilist
sysdeps/unix/sysv/linux/riscv/rv64/libm.abilist
sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist
sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist
sysdeps/unix/sysv/linux/sh/be/libm.abilist
sysdeps/unix/sysv/linux/sh/le/libm.abilist
sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist
sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist
sysdeps/unix/sysv/linux/x86_64/64/libm.abilist
sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist
sysdeps/x86_64/fpu/libm-test-ulps