diff options
author | Joseph Myers <josmyers@redhat.com> | 2024-06-17 13:47:09 +0000 |
---|---|---|
committer | Joseph Myers <josmyers@redhat.com> | 2024-06-17 13:47:09 +0000 |
commit | bb014f50c4a0c8d8db1ba5af55c104e430b5533d (patch) | |
tree | a1ca91748bb999691442701c3b786ebc3372114f /sysdeps/ieee754 | |
parent | ca38eff28015f376c020b4dfad5351e45be8d090 (diff) | |
download | glibc-bb014f50c4a0c8d8db1ba5af55c104e430b5533d.tar.gz glibc-bb014f50c4a0c8d8db1ba5af55c104e430b5533d.tar.xz glibc-bb014f50c4a0c8d8db1ba5af55c104e430b5533d.zip |
Implement C23 logp1
C23 adds various <math.h> function families originally defined in TS 18661-4. Add the logp1 functions (aliases for log1p functions - the name is intended to be more consistent with the new log2p1 and log10p1, where clearly it would have been very confusing to name those functions log21p and log101p). As aliases rather than new functions, the content of this patch is somewhat different from those actually adding new functions. Tests are shared with log1p, so this patch *does* mechanically update all affected libm-test-ulps files to expect the same errors for both functions. The vector versions of log1p on aarch64 and x86_64 are *not* updated to have logp1 aliases (and thus there are no corresponding header, tests, abilist or ulps changes for vector functions either). It would be reasonable for such vector aliases and corresponding changes to other files to be made separately. For now, the log1p tests instead avoid testing logp1 in the vector case (a Makefile change is needed to avoid problems with grep, used in generating the .c files for vector function tests, matching more than one ALL_RM_TEST line in a file testing multiple functions with the same inputs, when it assumes that the .inc file only has a single such line). Tested for x86_64 and x86, and with build-many-glibcs.py.
Diffstat (limited to 'sysdeps/ieee754')
-rw-r--r-- | sysdeps/ieee754/float128/Makefile | 2 | ||||
-rw-r--r-- | sysdeps/ieee754/float128/float128_private.h | 1 | ||||
-rw-r--r-- | sysdeps/ieee754/ldbl-128/Makefile | 2 | ||||
-rw-r--r-- | sysdeps/ieee754/ldbl-128ibm-compat/Versions | 1 | ||||
-rw-r--r-- | sysdeps/ieee754/ldbl-96/Makefile | 2 | ||||
-rw-r--r-- | sysdeps/ieee754/ldbl-opt/Makefile | 2 | ||||
-rw-r--r-- | sysdeps/ieee754/ldbl-opt/nldbl-log1p.c | 1 |
7 files changed, 7 insertions, 4 deletions
diff --git a/sysdeps/ieee754/float128/Makefile b/sysdeps/ieee754/float128/Makefile index f869e80f26..f0f6aae6ae 100644 --- a/sysdeps/ieee754/float128/Makefile +++ b/sysdeps/ieee754/float128/Makefile @@ -100,7 +100,7 @@ CFLAGS-s_llrintf128.c += -fno-builtin-llrintf64x CFLAGS-s_llroundf128.c += -fno-builtin-llroundf64x CFLAGS-e_logf128.c += -fno-builtin-logf64x CFLAGS-w_log10f128.c += -fno-builtin-log10f64x -CFLAGS-w_log1pf128.c += -fno-builtin-log1pf64x +CFLAGS-w_log1pf128.c += -fno-builtin-log1pf64x -fno-builtin-logp1f64x CFLAGS-e_log2f128.c += -fno-builtin-log2f64x CFLAGS-s_logbf128.c += -fno-builtin-logbf64x CFLAGS-s_lrintf128.c += -fno-builtin-lrintf64x diff --git a/sysdeps/ieee754/float128/float128_private.h b/sysdeps/ieee754/float128/float128_private.h index 38a8bdd0fe..19aa6c46f2 100644 --- a/sysdeps/ieee754/float128/float128_private.h +++ b/sysdeps/ieee754/float128/float128_private.h @@ -358,6 +358,7 @@ #define llroundl llroundf128 #define log1pl log1pf128 #define logbl logbf128 +#define logp1l logp1f128 #define logl logf128 #define lrintl lrintf128 #define lroundl lroundf128 diff --git a/sysdeps/ieee754/ldbl-128/Makefile b/sysdeps/ieee754/ldbl-128/Makefile index 9cbfc7ff6e..1901238c5b 100644 --- a/sysdeps/ieee754/ldbl-128/Makefile +++ b/sysdeps/ieee754/ldbl-128/Makefile @@ -89,7 +89,7 @@ CFLAGS-s_llrintl.c += -fno-builtin-llrintf64x -fno-builtin-llrintf128 CFLAGS-s_llroundl.c += -fno-builtin-llroundf64x -fno-builtin-llroundf128 CFLAGS-e_logl.c += -fno-builtin-logf64x -fno-builtin-logf128 CFLAGS-w_log10l.c += -fno-builtin-log10f64x -fno-builtin-log10f128 -CFLAGS-w_log1pl.c += -fno-builtin-log1pf64x -fno-builtin-log1pf128 +CFLAGS-w_log1pl.c += -fno-builtin-log1pf64x -fno-builtin-log1pf128 -fno-builtin-logp1f64x -fno-builtin-logp1f128 CFLAGS-e_log2l.c += -fno-builtin-log2f64x -fno-builtin-log2f128 CFLAGS-s_logbl.c += -fno-builtin-logbf64x -fno-builtin-logbf128 CFLAGS-s_lrintl.c += -fno-builtin-lrintf64x -fno-builtin-lrintf128 diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/Versions b/sysdeps/ieee754/ldbl-128ibm-compat/Versions index c9a74366fd..018e0a8871 100644 --- a/sysdeps/ieee754/ldbl-128ibm-compat/Versions +++ b/sysdeps/ieee754/ldbl-128ibm-compat/Versions @@ -139,6 +139,7 @@ libm { } GLIBC_2.40 { __log2p1ieee128; + __logp1ieee128; } } libc { diff --git a/sysdeps/ieee754/ldbl-96/Makefile b/sysdeps/ieee754/ldbl-96/Makefile index 170e77b2f9..a3ec2c54ca 100644 --- a/sysdeps/ieee754/ldbl-96/Makefile +++ b/sysdeps/ieee754/ldbl-96/Makefile @@ -110,7 +110,7 @@ CFLAGS-s_llrintl.c += -fno-builtin-llrintf64x CFLAGS-s_llroundl.c += -fno-builtin-llroundf64x CFLAGS-e_logl.c += -fno-builtin-logf64x CFLAGS-w_log10l.c += -fno-builtin-log10f64x -CFLAGS-w_log1pl.c += -fno-builtin-log1pf64x +CFLAGS-w_log1pl.c += -fno-builtin-log1pf64x -fno-builtin-logp1f64x CFLAGS-e_log2l.c += -fno-builtin-log2f64x CFLAGS-s_logbl.c += -fno-builtin-logbf64x CFLAGS-s_lrintl.c += -fno-builtin-lrintf64x diff --git a/sysdeps/ieee754/ldbl-opt/Makefile b/sysdeps/ieee754/ldbl-opt/Makefile index d1eda5d022..9c204ff9b3 100644 --- a/sysdeps/ieee754/ldbl-opt/Makefile +++ b/sysdeps/ieee754/ldbl-opt/Makefile @@ -341,7 +341,7 @@ CFLAGS-nldbl-llrint.c = -fno-builtin-llrintl CFLAGS-nldbl-llround.c = -fno-builtin-llroundl CFLAGS-nldbl-log.c = -fno-builtin-logl CFLAGS-nldbl-log10.c = -fno-builtin-log10l -CFLAGS-nldbl-log1p.c = -fno-builtin-log1pl +CFLAGS-nldbl-log1p.c = -fno-builtin-log1pl -fno-builtin-logp1l CFLAGS-nldbl-log2.c = -fno-builtin-log2l CFLAGS-nldbl-log2p1.c = -fno-builtin-log2p1l CFLAGS-nldbl-logb.c = -fno-builtin-logbl diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-log1p.c b/sysdeps/ieee754/ldbl-opt/nldbl-log1p.c index 455b25a9f4..b0de985183 100644 --- a/sysdeps/ieee754/ldbl-opt/nldbl-log1p.c +++ b/sysdeps/ieee754/ldbl-opt/nldbl-log1p.c @@ -6,3 +6,4 @@ log1pl (double x) { return log1p (x); } +weak_alias (log1pl, logp1l) |