1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-12-24 17:51:17 +03:00

Implement C23 compoundn

C23 adds various <math.h> function families originally defined in TS
18661-4.  Add the compoundn functions, which compute (1+X) to the
power Y for integer Y (and X at least -1).  The integer exponent has
type long long int in C23; it was intmax_t in TS 18661-4, and as with
other interfaces changed after their initial appearance in the TS, I
don't think we need to support the original version of the interface.

Note that these functions are "compoundn" with a trailing "n", *not*
"compound" (CORE-MATH has the wrong name, for example).

As with pown, I strongly encourage searching for worst cases for ulps
error for these implementations (necessarily non-exhaustively, given
the size of the input space).  I also expect a custom implementation
for a given format could be much faster as well as more accurate (I
haven't tested or benchmarked the CORE-MATH implementation for
binary32); this is one of the more complicated and less efficient
functions to implement in a type-generic way.

As with exp2m1 and exp10m1, this showed up places where the
powerpc64le IFUNC setup is not as self-contained as one might hope (in
this case, without the changes specific to powerpc64le, there were
undefined references to __GI___expf128).

Tested for x86_64 and x86, and with build-many-glibcs.py.
This commit is contained in:
Joseph Myers
2025-05-09 15:17:27 +00:00
parent f66cb3c9eb
commit ae31254432
52 changed files with 11082 additions and 4 deletions

View File

@@ -1355,6 +1355,14 @@ GLIBC_2.41 tanpif32x F
GLIBC_2.41 tanpif64 F
GLIBC_2.41 tanpif64x F
GLIBC_2.41 tanpil F
GLIBC_2.42 compoundn F
GLIBC_2.42 compoundnf F
GLIBC_2.42 compoundnf128 F
GLIBC_2.42 compoundnf32 F
GLIBC_2.42 compoundnf32x F
GLIBC_2.42 compoundnf64 F
GLIBC_2.42 compoundnf64x F
GLIBC_2.42 compoundnl F
GLIBC_2.42 pown F
GLIBC_2.42 pownf F
GLIBC_2.42 pownf128 F

View File

@@ -1245,6 +1245,14 @@ GLIBC_2.41 tanpif32x F
GLIBC_2.41 tanpif64 F
GLIBC_2.41 tanpif64x F
GLIBC_2.41 tanpil F
GLIBC_2.42 compoundn F
GLIBC_2.42 compoundnf F
GLIBC_2.42 compoundnf128 F
GLIBC_2.42 compoundnf32 F
GLIBC_2.42 compoundnf32x F
GLIBC_2.42 compoundnf64 F
GLIBC_2.42 compoundnf64x F
GLIBC_2.42 compoundnl F
GLIBC_2.42 pown F
GLIBC_2.42 pownf F
GLIBC_2.42 pownf128 F