]> git.ipfire.org Git - thirdparty/glibc.git/commit
Add gmp-arch and udiv_qrnnd
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Fri, 24 Oct 2025 11:24:32 +0000 (08:24 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Mon, 27 Oct 2025 18:45:52 +0000 (15:45 -0300)
commit1cd97c07861ba3bb57fe0501d61b0228e8a13858
tree7b44e76f72a395c38d77f35335ea8a3e3d2796b9
parent036196962b6e936e150ccccce9222ae4f35fcd20
Add gmp-arch and udiv_qrnnd

To enable “longlong.h” removal, the udiv_qrnnd is moved to a gmp-arch.h
file.  It allows each architecture to implement its own arch-specific
optimizations. The generic implementation now uses a static inline,
which provides better type checking than the GNU extension to cast the
asm constraint (and it works better with clang).

Most of the architecture uses the generic implementation, which is
expanded from a macro, except for alpha, x86, m68k, sh, and sparc.
I kept that alpha, which uses out-of-the-line implementations and x86,
where there is no easy way to use the div{q} instruction from C code.
For the rest, the compiler generates good enough code.

The hppa also provides arch-specific implementations, but they are not
routed in “longlong.h” and thus never used.
22 files changed:
soft-fp/soft-fp.h
stdio-common/_itoa.c
stdio-common/_itowa.c
stdlib/Makefile
stdlib/addmul_1.c
stdlib/divmod_1.c
stdlib/mod_1.c
stdlib/mul_1.c
stdlib/strtod_l.c
stdlib/submul_1.c
stdlib/udiv_qrnnd.c [deleted file]
sysdeps/alpha/Makefile
sysdeps/alpha/gmp-arch.h [new file with mode: 0644]
sysdeps/generic/gmp-arch.h [new file with mode: 0644]
sysdeps/hppa/hppa1.1/udiv_qrnnd.S [deleted file]
sysdeps/hppa/udiv_qrnnd.S [deleted file]
sysdeps/ieee754/dbl-64/dbl2mpn.c
sysdeps/ieee754/ldbl-128/ldbl2mpn.c
sysdeps/ieee754/ldbl-96/ldbl2mpn.c
sysdeps/wordsize-32/divdi3.c
sysdeps/x86/gmp-arch.h [new file with mode: 0644]
sysdeps/x86/ldbl2mpn.c