glibc/sysdeps
Joseph Myers 7ec903e028 Implement C23 exp2m1, exp10m1
C23 adds various <math.h> function families originally defined in TS
18661-4.  Add the exp2m1 and exp10m1 functions (exp2(x)-1 and
exp10(x)-1, like expm1).

As with other such functions, these use type-generic templates that
could be replaced with faster and more accurate type-specific
implementations in future.  Test inputs are copied from those for
expm1, plus some additions close to the overflow threshold (copied
from exp2 and exp10) and also some near the underflow threshold.

exp2m1 has the unusual property of having an input (M_MAX_EXP) where
whether the function overflows (under IEEE semantics) depends on the
rounding mode.  Although these could reasonably be XFAILed in the
testsuite (as we do in some cases for arguments very close to a
function's overflow threshold when an error of a few ulps in the
implementation can result in the implementation not agreeing with an
ideal one on whether overflow takes place - the testsuite isn't smart
enough to handle this automatically), since these functions aren't
required to be correctly rounding, I made the implementation check for
and handle this case specially.

The Makefile ordering expected by lint-makefiles for the new functions
is a bit peculiar, but I implemented it in this patch so that the test
passes; I don't know why log2 also needed moving in one Makefile
variable setting when it didn't in my previous patches, but the
failure showed a different place was expected for that function as
well.

The powerpc64le IFUNC setup seems not to be as self-contained as one
might hope; it shouldn't be necessary to add IFUNCs for new functions
such as these simply to get them building, but without setting up
IFUNCs for the new functions, there were undefined references to
__GI___expm1f128 (that IFUNC machinery results in no such function
being defined, but doesn't stop include/math.h from doing the
redirection resulting in the exp2m1f128 and exp10m1f128
implementations expecting to call it).

Tested for x86_64 and x86, and with build-many-glibcs.py.
2024-06-17 16:31:49 +00:00
..
aarch64 Implement C23 logp1 2024-06-17 13:47:09 +00:00
alpha Implement C23 logp1 2024-06-17 13:47:09 +00:00
arc Implement C23 logp1 2024-06-17 13:47:09 +00:00
arm Implement C23 logp1 2024-06-17 13:47:09 +00:00
csky Implement C23 logp1 2024-06-17 13:47:09 +00:00
generic login: Check default sizes of structs utmp, utmpx, lastlog 2024-04-19 14:38:17 +02:00
gnu login: Use unsigned 32-bit types for seconds-since-epoch 2024-04-19 14:38:17 +02:00
hppa Implement C23 logp1 2024-06-17 13:47:09 +00:00
htl htl: Implement some support for TLS_DTV_AT_TP 2024-03-23 23:00:30 +01:00
hurd hurd: Move internal functions to internal header 2024-03-23 22:43:07 +01:00
i386 Implement C23 exp2m1, exp10m1 2024-06-17 16:31:49 +00:00
ieee754 Implement C23 exp2m1, exp10m1 2024-06-17 16:31:49 +00:00
loongarch Implement C23 logp1 2024-06-17 13:47:09 +00:00
m68k Implement C23 logp1 2024-06-17 13:47:09 +00:00
mach Implement C23 exp2m1, exp10m1 2024-06-17 16:31:49 +00:00
microblaze Implement C23 logp1 2024-06-17 13:47:09 +00:00
mips Implement C23 logp1 2024-06-17 13:47:09 +00:00
nios2 Implement C23 logp1 2024-06-17 13:47:09 +00:00
nptl Always define __USE_TIME_BITS64 when 64 bit time_t is used 2024-04-02 15:28:36 -03:00
or1k Implement C23 logp1 2024-06-17 13:47:09 +00:00
posix posix: Sync tempname with gnulib 2024-04-10 14:53:39 -03:00
powerpc Implement C23 exp2m1, exp10m1 2024-06-17 16:31:49 +00:00
pthread Add crt1-2.0.o for glibc 2.0 compatibility tests 2024-05-06 07:49:40 -07:00
riscv Implement C23 logp1 2024-06-17 13:47:09 +00:00
s390 Implement C23 logp1 2024-06-17 13:47:09 +00:00
sh Implement C23 logp1 2024-06-17 13:47:09 +00:00
sparc Implement C23 logp1 2024-06-17 13:47:09 +00:00
unix Implement C23 exp2m1, exp10m1 2024-06-17 16:31:49 +00:00
wordsize-32 Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
wordsize-64 Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
x86 x86: Fix value for x86_memset_non_temporal_threshold when it is undesirable 2024-06-14 17:25:05 -05:00
x86_64 Implement C23 exp2m1, exp10m1 2024-06-17 16:31:49 +00:00