1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-11-30 11:41:39 +03:00

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.

Reviewed-by: Wilco Dijkstra  <Wilco.Dijkstra@arm.com>
This commit is contained in:
Adhemerval Zanella
2025-11-20 15:30:05 -03:00
parent e45174fe8c
commit 476e962af7
22 changed files with 219 additions and 402 deletions

View File

@@ -25,6 +25,7 @@ along with the GNU MP Library; see the file COPYING.LIB. If not, see
#include <stdbit.h>
#include "gmp-impl.h"
#include "longlong.h"
#include <gmp-arch.h>
#ifndef UMUL_TIME
#define UMUL_TIME 1