1995-02-18 02:27:10 +01:00
|
|
|
/* Include file for internal GNU MP types and definitions.
|
|
|
|
|
1996-03-01 19:45:35 +01:00
|
|
|
Copyright (C) 1991, 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
|
1995-02-18 02:27:10 +01:00
|
|
|
|
|
|
|
This file is part of the GNU MP Library.
|
|
|
|
|
|
|
|
The GNU MP Library is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU Library General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or (at your
|
|
|
|
option) any later version.
|
|
|
|
|
|
|
|
The GNU MP Library is distributed in the hope that it will be useful, but
|
|
|
|
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
|
|
|
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
|
|
|
License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Library General Public License
|
|
|
|
along with the GNU MP Library; see the file COPYING.LIB. If not, write to
|
1996-05-07 23:04:52 +02:00
|
|
|
the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
|
|
|
|
MA 02111-1307, USA. */
|
1995-02-18 02:27:10 +01:00
|
|
|
|
1996-03-01 19:45:35 +01:00
|
|
|
/* When using gcc, make sure to use its builtin alloca. */
|
|
|
|
#if ! defined (alloca) && defined (__GNUC__)
|
1995-02-18 02:27:10 +01:00
|
|
|
#define alloca __builtin_alloca
|
1996-03-01 19:45:35 +01:00
|
|
|
#define HAVE_ALLOCA
|
1995-02-18 02:27:10 +01:00
|
|
|
#endif
|
|
|
|
|
1996-03-01 19:45:35 +01:00
|
|
|
/* When using cc, do whatever necessary to allow use of alloca. For many
|
|
|
|
machines, this means including alloca.h. IBM's compilers need a #pragma
|
|
|
|
in "each module that needs to use alloca". */
|
Sat Oct 14 02:52:36 1995 Ulrich Drepper <drepper@ipd.info.uni-karlsruhe.de>
* malloc/malloc.c (_malloc_internal): Performance fix. Move
if statement out of loop.
* stdio/_itoa.c, stdio/_itoa.h: Complete rewrite. Much faster
implementation using GMP functions. Contributed by
Torbjorn Granlund and Ulrich Drepper.
* stdio/test_rdwr.c: Include <errno.h>.
* sysdeps/i386/i586/Implies: New file.
New highly optimized string functions for i[345]86.
* sysdeps/i386/memchr.S, sysdeps/i386/memcmp.S: New files.
* sysdeps/i386/stpcpy.S, sysdeps/i386/stpncpy.S: New files.
* sysdeps/i386/strchr.S, sysdeps/i386/strcspn.S: New files.
* sysdeps/i386/strpbrk.S, sysdeps/i386/strrchr.S: New files.
* sysdeps/i386/strspn.S, sysdeps/i386/i486/strcat.S: New files.
* sysdeps/i386/i486/strlen.S, sysdeps/i386/i586/strchr.S: New files.
* sysdeps/i386/i586/strlen.S: New file.
* sysdeps/i386/memchr.c: Removed. There is now an assembler version.
* sysdeps/i386/i586/memcopy.h (WORD_COPY_BWD): Parameters did
not correspond to used values.
* sysdeps/unix/sysv/linux/nfs/nfs.h: New file. Simply a wrapper
around a kernel header file.
* sysdeps/unix/sysv/linux/Dist: Add it.
* sysdeps/unix/sysv/linux/Makefile [$(subdir)=sunrpc] (headers):
Likewise.
* sysdeps/unix/sysv/linux/local_lim.h: Rewrite. Instead of
defining ourself we use a kernel header file.
* sysdeps/unix/sysv/linux/i386/sysdep.h (DO_CALL): Optimize system
call handler for i586.
* sysdeps/unix/sysv/linux/sys/param.h: Add copyright and clean up.
Sat Oct 14 02:52:36 1995 Ulrich Drepper <drepper@ipd.info.uni-karlsruhe.de>
* malloc/malloc.c (_malloc_internal): Performance fix. Move
if statement out of loop.
* stdio/_itoa.c, stdio/_itoa.h: Complete rewrite. Much faster
implementation using GMP functions. Contributed by
Torbjorn Granlund and Ulrich Drepper.
* stdio/test_rdwr.c: Include <errno.h>.
* sysdeps/i386/i586/Implies: New file.
New highly optimized string functions for i[345]86.
* sysdeps/i386/memchr.S, sysdeps/i386/memcmp.S: New files.
* sysdeps/i386/stpcpy.S, sysdeps/i386/stpncpy.S: New files.
* sysdeps/i386/strchr.S, sysdeps/i386/strcspn.S: New files.
* sysdeps/i386/strpbrk.S, sysdeps/i386/strrchr.S: New files.
* sysdeps/i386/strspn.S, sysdeps/i386/i486/strcat.S: New files.
* sysdeps/i386/i486/strlen.S, sysdeps/i386/i586/strchr.S: New files.
* sysdeps/i386/i586/strlen.S: New file.
* sysdeps/i386/memchr.c: Removed. There is now an assembler version.
* sysdeps/i386/i586/memcopy.h (WORD_COPY_BWD): Parameters did
not correspond to used values.
* sysdeps/unix/sysv/linux/nfs/nfs.h: New file. Simply a wrapper
around a kernel header file.
* sysdeps/unix/sysv/linux/Dist: Add it.
* sysdeps/unix/sysv/linux/Makefile [$(subdir)=sunrpc] (headers):
Likewise.
* sysdeps/unix/sysv/linux/local_lim.h: Rewrite. Instead of
defining ourself we use a kernel header file.
* sysdeps/unix/sysv/linux/i386/sysdep.h (DO_CALL): Optimize system
call handler for i586.
* sysdeps/unix/sysv/linux/sys/param.h: Add copyright and clean up.
1995-10-16 02:37:51 +01:00
|
|
|
#if ! defined (alloca)
|
1996-03-01 19:45:35 +01:00
|
|
|
/* We need lots of variants for MIPS, to cover all versions and perversions
|
|
|
|
of OSes for MIPS. */
|
|
|
|
#if defined (__mips) || defined (MIPSEL) || defined (MIPSEB) \
|
|
|
|
|| defined (_MIPSEL) || defined (_MIPSEB) || defined (__sgi) \
|
|
|
|
|| defined (__alpha) || defined (__sparc) || defined (sparc) \
|
|
|
|
|| defined (__ksr__)
|
Sat Oct 14 02:52:36 1995 Ulrich Drepper <drepper@ipd.info.uni-karlsruhe.de>
* malloc/malloc.c (_malloc_internal): Performance fix. Move
if statement out of loop.
* stdio/_itoa.c, stdio/_itoa.h: Complete rewrite. Much faster
implementation using GMP functions. Contributed by
Torbjorn Granlund and Ulrich Drepper.
* stdio/test_rdwr.c: Include <errno.h>.
* sysdeps/i386/i586/Implies: New file.
New highly optimized string functions for i[345]86.
* sysdeps/i386/memchr.S, sysdeps/i386/memcmp.S: New files.
* sysdeps/i386/stpcpy.S, sysdeps/i386/stpncpy.S: New files.
* sysdeps/i386/strchr.S, sysdeps/i386/strcspn.S: New files.
* sysdeps/i386/strpbrk.S, sysdeps/i386/strrchr.S: New files.
* sysdeps/i386/strspn.S, sysdeps/i386/i486/strcat.S: New files.
* sysdeps/i386/i486/strlen.S, sysdeps/i386/i586/strchr.S: New files.
* sysdeps/i386/i586/strlen.S: New file.
* sysdeps/i386/memchr.c: Removed. There is now an assembler version.
* sysdeps/i386/i586/memcopy.h (WORD_COPY_BWD): Parameters did
not correspond to used values.
* sysdeps/unix/sysv/linux/nfs/nfs.h: New file. Simply a wrapper
around a kernel header file.
* sysdeps/unix/sysv/linux/Dist: Add it.
* sysdeps/unix/sysv/linux/Makefile [$(subdir)=sunrpc] (headers):
Likewise.
* sysdeps/unix/sysv/linux/local_lim.h: Rewrite. Instead of
defining ourself we use a kernel header file.
* sysdeps/unix/sysv/linux/i386/sysdep.h (DO_CALL): Optimize system
call handler for i586.
* sysdeps/unix/sysv/linux/sys/param.h: Add copyright and clean up.
Sat Oct 14 02:52:36 1995 Ulrich Drepper <drepper@ipd.info.uni-karlsruhe.de>
* malloc/malloc.c (_malloc_internal): Performance fix. Move
if statement out of loop.
* stdio/_itoa.c, stdio/_itoa.h: Complete rewrite. Much faster
implementation using GMP functions. Contributed by
Torbjorn Granlund and Ulrich Drepper.
* stdio/test_rdwr.c: Include <errno.h>.
* sysdeps/i386/i586/Implies: New file.
New highly optimized string functions for i[345]86.
* sysdeps/i386/memchr.S, sysdeps/i386/memcmp.S: New files.
* sysdeps/i386/stpcpy.S, sysdeps/i386/stpncpy.S: New files.
* sysdeps/i386/strchr.S, sysdeps/i386/strcspn.S: New files.
* sysdeps/i386/strpbrk.S, sysdeps/i386/strrchr.S: New files.
* sysdeps/i386/strspn.S, sysdeps/i386/i486/strcat.S: New files.
* sysdeps/i386/i486/strlen.S, sysdeps/i386/i586/strchr.S: New files.
* sysdeps/i386/i586/strlen.S: New file.
* sysdeps/i386/memchr.c: Removed. There is now an assembler version.
* sysdeps/i386/i586/memcopy.h (WORD_COPY_BWD): Parameters did
not correspond to used values.
* sysdeps/unix/sysv/linux/nfs/nfs.h: New file. Simply a wrapper
around a kernel header file.
* sysdeps/unix/sysv/linux/Dist: Add it.
* sysdeps/unix/sysv/linux/Makefile [$(subdir)=sunrpc] (headers):
Likewise.
* sysdeps/unix/sysv/linux/local_lim.h: Rewrite. Instead of
defining ourself we use a kernel header file.
* sysdeps/unix/sysv/linux/i386/sysdep.h (DO_CALL): Optimize system
call handler for i586.
* sysdeps/unix/sysv/linux/sys/param.h: Add copyright and clean up.
1995-10-16 02:37:51 +01:00
|
|
|
#include <alloca.h>
|
1996-03-01 19:45:35 +01:00
|
|
|
#define HAVE_ALLOCA
|
|
|
|
#endif
|
|
|
|
#if defined (_IBMR2)
|
|
|
|
#pragma alloca
|
|
|
|
#define HAVE_ALLOCA
|
|
|
|
#endif
|
|
|
|
#if defined (__DECC)
|
|
|
|
#define alloca(x) __ALLOCA(x)
|
|
|
|
#define HAVE_ALLOCA
|
Sat Oct 14 02:52:36 1995 Ulrich Drepper <drepper@ipd.info.uni-karlsruhe.de>
* malloc/malloc.c (_malloc_internal): Performance fix. Move
if statement out of loop.
* stdio/_itoa.c, stdio/_itoa.h: Complete rewrite. Much faster
implementation using GMP functions. Contributed by
Torbjorn Granlund and Ulrich Drepper.
* stdio/test_rdwr.c: Include <errno.h>.
* sysdeps/i386/i586/Implies: New file.
New highly optimized string functions for i[345]86.
* sysdeps/i386/memchr.S, sysdeps/i386/memcmp.S: New files.
* sysdeps/i386/stpcpy.S, sysdeps/i386/stpncpy.S: New files.
* sysdeps/i386/strchr.S, sysdeps/i386/strcspn.S: New files.
* sysdeps/i386/strpbrk.S, sysdeps/i386/strrchr.S: New files.
* sysdeps/i386/strspn.S, sysdeps/i386/i486/strcat.S: New files.
* sysdeps/i386/i486/strlen.S, sysdeps/i386/i586/strchr.S: New files.
* sysdeps/i386/i586/strlen.S: New file.
* sysdeps/i386/memchr.c: Removed. There is now an assembler version.
* sysdeps/i386/i586/memcopy.h (WORD_COPY_BWD): Parameters did
not correspond to used values.
* sysdeps/unix/sysv/linux/nfs/nfs.h: New file. Simply a wrapper
around a kernel header file.
* sysdeps/unix/sysv/linux/Dist: Add it.
* sysdeps/unix/sysv/linux/Makefile [$(subdir)=sunrpc] (headers):
Likewise.
* sysdeps/unix/sysv/linux/local_lim.h: Rewrite. Instead of
defining ourself we use a kernel header file.
* sysdeps/unix/sysv/linux/i386/sysdep.h (DO_CALL): Optimize system
call handler for i586.
* sysdeps/unix/sysv/linux/sys/param.h: Add copyright and clean up.
Sat Oct 14 02:52:36 1995 Ulrich Drepper <drepper@ipd.info.uni-karlsruhe.de>
* malloc/malloc.c (_malloc_internal): Performance fix. Move
if statement out of loop.
* stdio/_itoa.c, stdio/_itoa.h: Complete rewrite. Much faster
implementation using GMP functions. Contributed by
Torbjorn Granlund and Ulrich Drepper.
* stdio/test_rdwr.c: Include <errno.h>.
* sysdeps/i386/i586/Implies: New file.
New highly optimized string functions for i[345]86.
* sysdeps/i386/memchr.S, sysdeps/i386/memcmp.S: New files.
* sysdeps/i386/stpcpy.S, sysdeps/i386/stpncpy.S: New files.
* sysdeps/i386/strchr.S, sysdeps/i386/strcspn.S: New files.
* sysdeps/i386/strpbrk.S, sysdeps/i386/strrchr.S: New files.
* sysdeps/i386/strspn.S, sysdeps/i386/i486/strcat.S: New files.
* sysdeps/i386/i486/strlen.S, sysdeps/i386/i586/strchr.S: New files.
* sysdeps/i386/i586/strlen.S: New file.
* sysdeps/i386/memchr.c: Removed. There is now an assembler version.
* sysdeps/i386/i586/memcopy.h (WORD_COPY_BWD): Parameters did
not correspond to used values.
* sysdeps/unix/sysv/linux/nfs/nfs.h: New file. Simply a wrapper
around a kernel header file.
* sysdeps/unix/sysv/linux/Dist: Add it.
* sysdeps/unix/sysv/linux/Makefile [$(subdir)=sunrpc] (headers):
Likewise.
* sysdeps/unix/sysv/linux/local_lim.h: Rewrite. Instead of
defining ourself we use a kernel header file.
* sysdeps/unix/sysv/linux/i386/sysdep.h (DO_CALL): Optimize system
call handler for i586.
* sysdeps/unix/sysv/linux/sys/param.h: Add copyright and clean up.
1995-10-16 02:37:51 +01:00
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
1996-03-01 19:45:35 +01:00
|
|
|
#if ! defined (HAVE_ALLOCA) || USE_STACK_ALLOC
|
|
|
|
#include "stack-alloc.h"
|
|
|
|
#else
|
|
|
|
#define TMP_DECL(m)
|
|
|
|
#define TMP_ALLOC(x) alloca(x)
|
|
|
|
#define TMP_MARK(m)
|
|
|
|
#define TMP_FREE(m)
|
|
|
|
#endif
|
|
|
|
|
1995-02-18 02:27:10 +01:00
|
|
|
#ifndef NULL
|
1996-03-01 19:45:35 +01:00
|
|
|
#define NULL ((void *) 0)
|
1995-02-18 02:27:10 +01:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#if ! defined (__GNUC__)
|
|
|
|
#define inline /* Empty */
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define ABS(x) (x >= 0 ? x : -x)
|
1996-12-22 01:32:43 +01:00
|
|
|
#ifndef MIN
|
1995-02-18 02:27:10 +01:00
|
|
|
#define MIN(l,o) ((l) < (o) ? (l) : (o))
|
1996-12-22 01:32:43 +01:00
|
|
|
#endif
|
|
|
|
#ifndef MAX
|
1995-02-18 02:27:10 +01:00
|
|
|
#define MAX(h,i) ((h) > (i) ? (h) : (i))
|
1996-12-22 01:32:43 +01:00
|
|
|
#endif
|
1995-02-18 02:27:10 +01:00
|
|
|
|
1996-05-07 23:04:52 +02:00
|
|
|
/* Field access macros. */
|
|
|
|
#define SIZ(x) ((x)->_mp_size)
|
|
|
|
#define ABSIZ(x) ABS (SIZ (x))
|
|
|
|
#define PTR(x) ((x)->_mp_d)
|
|
|
|
#define EXP(x) ((x)->_mp_exp)
|
|
|
|
#define PREC(x) ((x)->_mp_prec)
|
|
|
|
#define ALLOC(x) ((x)->_mp_alloc)
|
|
|
|
|
1995-02-18 02:27:10 +01:00
|
|
|
#include "gmp-mparam.h"
|
|
|
|
/* #include "longlong.h" */
|
|
|
|
|
1996-03-01 19:45:35 +01:00
|
|
|
#if defined (__STDC__) || defined (__cplusplus)
|
1995-02-18 02:27:10 +01:00
|
|
|
void *malloc (size_t);
|
|
|
|
void *realloc (void *, size_t);
|
|
|
|
void free (void *);
|
|
|
|
|
|
|
|
extern void * (*_mp_allocate_func) (size_t);
|
|
|
|
extern void * (*_mp_reallocate_func) (void *, size_t, size_t);
|
|
|
|
extern void (*_mp_free_func) (void *, size_t);
|
|
|
|
|
|
|
|
void *_mp_default_allocate (size_t);
|
|
|
|
void *_mp_default_reallocate (void *, size_t, size_t);
|
|
|
|
void _mp_default_free (void *, size_t);
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
#define const /* Empty */
|
|
|
|
#define signed /* Empty */
|
|
|
|
|
|
|
|
void *malloc ();
|
|
|
|
void *realloc ();
|
|
|
|
void free ();
|
|
|
|
|
|
|
|
extern void * (*_mp_allocate_func) ();
|
|
|
|
extern void * (*_mp_reallocate_func) ();
|
|
|
|
extern void (*_mp_free_func) ();
|
|
|
|
|
|
|
|
void *_mp_default_allocate ();
|
|
|
|
void *_mp_default_reallocate ();
|
|
|
|
void _mp_default_free ();
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Copy NLIMBS *limbs* from SRC to DST. */
|
|
|
|
#define MPN_COPY_INCR(DST, SRC, NLIMBS) \
|
|
|
|
do { \
|
|
|
|
mp_size_t __i; \
|
|
|
|
for (__i = 0; __i < (NLIMBS); __i++) \
|
|
|
|
(DST)[__i] = (SRC)[__i]; \
|
|
|
|
} while (0)
|
|
|
|
#define MPN_COPY_DECR(DST, SRC, NLIMBS) \
|
|
|
|
do { \
|
|
|
|
mp_size_t __i; \
|
|
|
|
for (__i = (NLIMBS) - 1; __i >= 0; __i--) \
|
|
|
|
(DST)[__i] = (SRC)[__i]; \
|
|
|
|
} while (0)
|
|
|
|
#define MPN_COPY MPN_COPY_INCR
|
|
|
|
|
|
|
|
/* Zero NLIMBS *limbs* AT DST. */
|
|
|
|
#define MPN_ZERO(DST, NLIMBS) \
|
|
|
|
do { \
|
|
|
|
mp_size_t __i; \
|
|
|
|
for (__i = 0; __i < (NLIMBS); __i++) \
|
|
|
|
(DST)[__i] = 0; \
|
|
|
|
} while (0)
|
|
|
|
|
|
|
|
#define MPN_NORMALIZE(DST, NLIMBS) \
|
|
|
|
do { \
|
|
|
|
while (NLIMBS > 0) \
|
|
|
|
{ \
|
|
|
|
if ((DST)[(NLIMBS) - 1] != 0) \
|
|
|
|
break; \
|
|
|
|
NLIMBS--; \
|
|
|
|
} \
|
|
|
|
} while (0)
|
|
|
|
#define MPN_NORMALIZE_NOT_ZERO(DST, NLIMBS) \
|
|
|
|
do { \
|
|
|
|
while (1) \
|
|
|
|
{ \
|
|
|
|
if ((DST)[(NLIMBS) - 1] != 0) \
|
|
|
|
break; \
|
|
|
|
NLIMBS--; \
|
|
|
|
} \
|
|
|
|
} while (0)
|
|
|
|
|
|
|
|
/* Initialize the MP_INT X with space for NLIMBS limbs.
|
|
|
|
X should be a temporary variable, and it will be automatically
|
|
|
|
cleared out when the running function returns.
|
|
|
|
We use __x here to make it possible to accept both mpz_ptr and mpz_t
|
|
|
|
arguments. */
|
|
|
|
#define MPZ_TMP_INIT(X, NLIMBS) \
|
|
|
|
do { \
|
|
|
|
mpz_ptr __x = (X); \
|
1996-03-01 19:45:35 +01:00
|
|
|
__x->_mp_alloc = (NLIMBS); \
|
|
|
|
__x->_mp_d = (mp_ptr) TMP_ALLOC ((NLIMBS) * BYTES_PER_MP_LIMB); \
|
1995-02-18 02:27:10 +01:00
|
|
|
} while (0)
|
|
|
|
|
|
|
|
#define MPN_MUL_N_RECURSE(prodp, up, vp, size, tspace) \
|
|
|
|
do { \
|
|
|
|
if ((size) < KARATSUBA_THRESHOLD) \
|
1996-03-01 19:45:35 +01:00
|
|
|
impn_mul_n_basecase (prodp, up, vp, size); \
|
1995-02-18 02:27:10 +01:00
|
|
|
else \
|
1996-03-01 19:45:35 +01:00
|
|
|
impn_mul_n (prodp, up, vp, size, tspace); \
|
1995-02-18 02:27:10 +01:00
|
|
|
} while (0);
|
|
|
|
#define MPN_SQR_N_RECURSE(prodp, up, size, tspace) \
|
|
|
|
do { \
|
|
|
|
if ((size) < KARATSUBA_THRESHOLD) \
|
1996-03-01 19:45:35 +01:00
|
|
|
impn_sqr_n_basecase (prodp, up, size); \
|
1995-02-18 02:27:10 +01:00
|
|
|
else \
|
1996-03-01 19:45:35 +01:00
|
|
|
impn_sqr_n (prodp, up, size, tspace); \
|
1995-02-18 02:27:10 +01:00
|
|
|
} while (0);
|
|
|
|
|
|
|
|
/* Structure for conversion between internal binary format and
|
|
|
|
strings in base 2..36. */
|
|
|
|
struct bases
|
|
|
|
{
|
1996-05-07 23:04:52 +02:00
|
|
|
/* Number of digits in the conversion base that always fits in an mp_limb_t.
|
|
|
|
For example, for base 10 on a machine where a mp_limb_t has 32 bits this
|
|
|
|
is 9, since 10**9 is the largest number that fits into a mp_limb_t. */
|
1995-02-18 02:27:10 +01:00
|
|
|
int chars_per_limb;
|
|
|
|
|
|
|
|
/* log(2)/log(conversion_base) */
|
|
|
|
float chars_per_bit_exactly;
|
|
|
|
|
1995-12-04 19:37:56 +01:00
|
|
|
/* base**chars_per_limb, i.e. the biggest number that fits a word, built by
|
|
|
|
factors of base. Exception: For 2, 4, 8, etc, big_base is log2(base),
|
|
|
|
i.e. the number of bits used to represent each digit in the base. */
|
1996-05-07 23:04:52 +02:00
|
|
|
mp_limb_t big_base;
|
1995-02-18 02:27:10 +01:00
|
|
|
|
1995-12-04 19:37:56 +01:00
|
|
|
/* A BITS_PER_MP_LIMB bit approximation to 1/big_base, represented as a
|
|
|
|
fixed-point number. Instead of dividing by big_base an application can
|
|
|
|
choose to multiply by big_base_inverted. */
|
1996-05-07 23:04:52 +02:00
|
|
|
mp_limb_t big_base_inverted;
|
1995-02-18 02:27:10 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
extern const struct bases __mp_bases[];
|
|
|
|
extern mp_size_t __gmp_default_fp_limb_precision;
|
|
|
|
|
Sat Oct 14 02:52:36 1995 Ulrich Drepper <drepper@ipd.info.uni-karlsruhe.de>
* malloc/malloc.c (_malloc_internal): Performance fix. Move
if statement out of loop.
* stdio/_itoa.c, stdio/_itoa.h: Complete rewrite. Much faster
implementation using GMP functions. Contributed by
Torbjorn Granlund and Ulrich Drepper.
* stdio/test_rdwr.c: Include <errno.h>.
* sysdeps/i386/i586/Implies: New file.
New highly optimized string functions for i[345]86.
* sysdeps/i386/memchr.S, sysdeps/i386/memcmp.S: New files.
* sysdeps/i386/stpcpy.S, sysdeps/i386/stpncpy.S: New files.
* sysdeps/i386/strchr.S, sysdeps/i386/strcspn.S: New files.
* sysdeps/i386/strpbrk.S, sysdeps/i386/strrchr.S: New files.
* sysdeps/i386/strspn.S, sysdeps/i386/i486/strcat.S: New files.
* sysdeps/i386/i486/strlen.S, sysdeps/i386/i586/strchr.S: New files.
* sysdeps/i386/i586/strlen.S: New file.
* sysdeps/i386/memchr.c: Removed. There is now an assembler version.
* sysdeps/i386/i586/memcopy.h (WORD_COPY_BWD): Parameters did
not correspond to used values.
* sysdeps/unix/sysv/linux/nfs/nfs.h: New file. Simply a wrapper
around a kernel header file.
* sysdeps/unix/sysv/linux/Dist: Add it.
* sysdeps/unix/sysv/linux/Makefile [$(subdir)=sunrpc] (headers):
Likewise.
* sysdeps/unix/sysv/linux/local_lim.h: Rewrite. Instead of
defining ourself we use a kernel header file.
* sysdeps/unix/sysv/linux/i386/sysdep.h (DO_CALL): Optimize system
call handler for i586.
* sysdeps/unix/sysv/linux/sys/param.h: Add copyright and clean up.
Sat Oct 14 02:52:36 1995 Ulrich Drepper <drepper@ipd.info.uni-karlsruhe.de>
* malloc/malloc.c (_malloc_internal): Performance fix. Move
if statement out of loop.
* stdio/_itoa.c, stdio/_itoa.h: Complete rewrite. Much faster
implementation using GMP functions. Contributed by
Torbjorn Granlund and Ulrich Drepper.
* stdio/test_rdwr.c: Include <errno.h>.
* sysdeps/i386/i586/Implies: New file.
New highly optimized string functions for i[345]86.
* sysdeps/i386/memchr.S, sysdeps/i386/memcmp.S: New files.
* sysdeps/i386/stpcpy.S, sysdeps/i386/stpncpy.S: New files.
* sysdeps/i386/strchr.S, sysdeps/i386/strcspn.S: New files.
* sysdeps/i386/strpbrk.S, sysdeps/i386/strrchr.S: New files.
* sysdeps/i386/strspn.S, sysdeps/i386/i486/strcat.S: New files.
* sysdeps/i386/i486/strlen.S, sysdeps/i386/i586/strchr.S: New files.
* sysdeps/i386/i586/strlen.S: New file.
* sysdeps/i386/memchr.c: Removed. There is now an assembler version.
* sysdeps/i386/i586/memcopy.h (WORD_COPY_BWD): Parameters did
not correspond to used values.
* sysdeps/unix/sysv/linux/nfs/nfs.h: New file. Simply a wrapper
around a kernel header file.
* sysdeps/unix/sysv/linux/Dist: Add it.
* sysdeps/unix/sysv/linux/Makefile [$(subdir)=sunrpc] (headers):
Likewise.
* sysdeps/unix/sysv/linux/local_lim.h: Rewrite. Instead of
defining ourself we use a kernel header file.
* sysdeps/unix/sysv/linux/i386/sysdep.h (DO_CALL): Optimize system
call handler for i586.
* sysdeps/unix/sysv/linux/sys/param.h: Add copyright and clean up.
1995-10-16 02:37:51 +01:00
|
|
|
/* Divide the two-limb number in (NH,,NL) by D, with DI being the largest
|
|
|
|
limb not larger than (2**(2*BITS_PER_MP_LIMB))/D - (2**BITS_PER_MP_LIMB).
|
|
|
|
If this would yield overflow, DI should be the largest possible number
|
|
|
|
(i.e., only ones). For correct operation, the most significant bit of D
|
|
|
|
has to be set. Put the quotient in Q and the remainder in R. */
|
1995-02-18 02:27:10 +01:00
|
|
|
#define udiv_qrnnd_preinv(q, r, nh, nl, d, di) \
|
|
|
|
do { \
|
1996-05-07 23:04:52 +02:00
|
|
|
mp_limb_t _q, _ql, _r; \
|
|
|
|
mp_limb_t _xh, _xl; \
|
1995-02-18 02:27:10 +01:00
|
|
|
umul_ppmm (_q, _ql, (nh), (di)); \
|
|
|
|
_q += (nh); /* DI is 2**BITS_PER_MP_LIMB too small */\
|
|
|
|
umul_ppmm (_xh, _xl, _q, (d)); \
|
|
|
|
sub_ddmmss (_xh, _r, (nh), (nl), _xh, _xl); \
|
|
|
|
if (_xh != 0) \
|
|
|
|
{ \
|
|
|
|
sub_ddmmss (_xh, _r, _xh, _r, 0, (d)); \
|
|
|
|
_q += 1; \
|
|
|
|
if (_xh != 0) \
|
|
|
|
{ \
|
|
|
|
sub_ddmmss (_xh, _r, _xh, _r, 0, (d)); \
|
|
|
|
_q += 1; \
|
|
|
|
} \
|
|
|
|
} \
|
|
|
|
if (_r >= (d)) \
|
|
|
|
{ \
|
|
|
|
_r -= (d); \
|
|
|
|
_q += 1; \
|
|
|
|
} \
|
|
|
|
(r) = _r; \
|
|
|
|
(q) = _q; \
|
|
|
|
} while (0)
|
Sat Oct 14 02:52:36 1995 Ulrich Drepper <drepper@ipd.info.uni-karlsruhe.de>
* malloc/malloc.c (_malloc_internal): Performance fix. Move
if statement out of loop.
* stdio/_itoa.c, stdio/_itoa.h: Complete rewrite. Much faster
implementation using GMP functions. Contributed by
Torbjorn Granlund and Ulrich Drepper.
* stdio/test_rdwr.c: Include <errno.h>.
* sysdeps/i386/i586/Implies: New file.
New highly optimized string functions for i[345]86.
* sysdeps/i386/memchr.S, sysdeps/i386/memcmp.S: New files.
* sysdeps/i386/stpcpy.S, sysdeps/i386/stpncpy.S: New files.
* sysdeps/i386/strchr.S, sysdeps/i386/strcspn.S: New files.
* sysdeps/i386/strpbrk.S, sysdeps/i386/strrchr.S: New files.
* sysdeps/i386/strspn.S, sysdeps/i386/i486/strcat.S: New files.
* sysdeps/i386/i486/strlen.S, sysdeps/i386/i586/strchr.S: New files.
* sysdeps/i386/i586/strlen.S: New file.
* sysdeps/i386/memchr.c: Removed. There is now an assembler version.
* sysdeps/i386/i586/memcopy.h (WORD_COPY_BWD): Parameters did
not correspond to used values.
* sysdeps/unix/sysv/linux/nfs/nfs.h: New file. Simply a wrapper
around a kernel header file.
* sysdeps/unix/sysv/linux/Dist: Add it.
* sysdeps/unix/sysv/linux/Makefile [$(subdir)=sunrpc] (headers):
Likewise.
* sysdeps/unix/sysv/linux/local_lim.h: Rewrite. Instead of
defining ourself we use a kernel header file.
* sysdeps/unix/sysv/linux/i386/sysdep.h (DO_CALL): Optimize system
call handler for i586.
* sysdeps/unix/sysv/linux/sys/param.h: Add copyright and clean up.
Sat Oct 14 02:52:36 1995 Ulrich Drepper <drepper@ipd.info.uni-karlsruhe.de>
* malloc/malloc.c (_malloc_internal): Performance fix. Move
if statement out of loop.
* stdio/_itoa.c, stdio/_itoa.h: Complete rewrite. Much faster
implementation using GMP functions. Contributed by
Torbjorn Granlund and Ulrich Drepper.
* stdio/test_rdwr.c: Include <errno.h>.
* sysdeps/i386/i586/Implies: New file.
New highly optimized string functions for i[345]86.
* sysdeps/i386/memchr.S, sysdeps/i386/memcmp.S: New files.
* sysdeps/i386/stpcpy.S, sysdeps/i386/stpncpy.S: New files.
* sysdeps/i386/strchr.S, sysdeps/i386/strcspn.S: New files.
* sysdeps/i386/strpbrk.S, sysdeps/i386/strrchr.S: New files.
* sysdeps/i386/strspn.S, sysdeps/i386/i486/strcat.S: New files.
* sysdeps/i386/i486/strlen.S, sysdeps/i386/i586/strchr.S: New files.
* sysdeps/i386/i586/strlen.S: New file.
* sysdeps/i386/memchr.c: Removed. There is now an assembler version.
* sysdeps/i386/i586/memcopy.h (WORD_COPY_BWD): Parameters did
not correspond to used values.
* sysdeps/unix/sysv/linux/nfs/nfs.h: New file. Simply a wrapper
around a kernel header file.
* sysdeps/unix/sysv/linux/Dist: Add it.
* sysdeps/unix/sysv/linux/Makefile [$(subdir)=sunrpc] (headers):
Likewise.
* sysdeps/unix/sysv/linux/local_lim.h: Rewrite. Instead of
defining ourself we use a kernel header file.
* sysdeps/unix/sysv/linux/i386/sysdep.h (DO_CALL): Optimize system
call handler for i586.
* sysdeps/unix/sysv/linux/sys/param.h: Add copyright and clean up.
1995-10-16 02:37:51 +01:00
|
|
|
/* Like udiv_qrnnd_preinv, but for for any value D. DNORM is D shifted left
|
|
|
|
so that its most significant bit is set. LGUP is ceil(log2(D)). */
|
1995-02-18 02:27:10 +01:00
|
|
|
#define udiv_qrnnd_preinv2gen(q, r, nh, nl, d, di, dnorm, lgup) \
|
|
|
|
do { \
|
1996-05-07 23:04:52 +02:00
|
|
|
mp_limb_t n2, n10, n1, nadj, q1; \
|
|
|
|
mp_limb_t _xh, _xl; \
|
1995-02-18 02:27:10 +01:00
|
|
|
n2 = ((nh) << (BITS_PER_MP_LIMB - (lgup))) + ((nl) >> 1 >> (l - 1));\
|
|
|
|
n10 = (nl) << (BITS_PER_MP_LIMB - (lgup)); \
|
1996-05-07 23:04:52 +02:00
|
|
|
n1 = ((mp_limb_signed_t) n10 >> (BITS_PER_MP_LIMB - 1)); \
|
1995-02-18 02:27:10 +01:00
|
|
|
nadj = n10 + (n1 & (dnorm)); \
|
|
|
|
umul_ppmm (_xh, _xl, di, n2 - n1); \
|
|
|
|
add_ssaaaa (_xh, _xl, _xh, _xl, 0, nadj); \
|
|
|
|
q1 = ~(n2 + _xh); \
|
|
|
|
umul_ppmm (_xh, _xl, q1, d); \
|
|
|
|
add_ssaaaa (_xh, _xl, _xh, _xl, nh, nl); \
|
|
|
|
_xh -= (d); \
|
|
|
|
(r) = _xl + ((d) & _xh); \
|
|
|
|
(q) = _xh - q1; \
|
|
|
|
} while (0)
|
Sat Oct 14 02:52:36 1995 Ulrich Drepper <drepper@ipd.info.uni-karlsruhe.de>
* malloc/malloc.c (_malloc_internal): Performance fix. Move
if statement out of loop.
* stdio/_itoa.c, stdio/_itoa.h: Complete rewrite. Much faster
implementation using GMP functions. Contributed by
Torbjorn Granlund and Ulrich Drepper.
* stdio/test_rdwr.c: Include <errno.h>.
* sysdeps/i386/i586/Implies: New file.
New highly optimized string functions for i[345]86.
* sysdeps/i386/memchr.S, sysdeps/i386/memcmp.S: New files.
* sysdeps/i386/stpcpy.S, sysdeps/i386/stpncpy.S: New files.
* sysdeps/i386/strchr.S, sysdeps/i386/strcspn.S: New files.
* sysdeps/i386/strpbrk.S, sysdeps/i386/strrchr.S: New files.
* sysdeps/i386/strspn.S, sysdeps/i386/i486/strcat.S: New files.
* sysdeps/i386/i486/strlen.S, sysdeps/i386/i586/strchr.S: New files.
* sysdeps/i386/i586/strlen.S: New file.
* sysdeps/i386/memchr.c: Removed. There is now an assembler version.
* sysdeps/i386/i586/memcopy.h (WORD_COPY_BWD): Parameters did
not correspond to used values.
* sysdeps/unix/sysv/linux/nfs/nfs.h: New file. Simply a wrapper
around a kernel header file.
* sysdeps/unix/sysv/linux/Dist: Add it.
* sysdeps/unix/sysv/linux/Makefile [$(subdir)=sunrpc] (headers):
Likewise.
* sysdeps/unix/sysv/linux/local_lim.h: Rewrite. Instead of
defining ourself we use a kernel header file.
* sysdeps/unix/sysv/linux/i386/sysdep.h (DO_CALL): Optimize system
call handler for i586.
* sysdeps/unix/sysv/linux/sys/param.h: Add copyright and clean up.
Sat Oct 14 02:52:36 1995 Ulrich Drepper <drepper@ipd.info.uni-karlsruhe.de>
* malloc/malloc.c (_malloc_internal): Performance fix. Move
if statement out of loop.
* stdio/_itoa.c, stdio/_itoa.h: Complete rewrite. Much faster
implementation using GMP functions. Contributed by
Torbjorn Granlund and Ulrich Drepper.
* stdio/test_rdwr.c: Include <errno.h>.
* sysdeps/i386/i586/Implies: New file.
New highly optimized string functions for i[345]86.
* sysdeps/i386/memchr.S, sysdeps/i386/memcmp.S: New files.
* sysdeps/i386/stpcpy.S, sysdeps/i386/stpncpy.S: New files.
* sysdeps/i386/strchr.S, sysdeps/i386/strcspn.S: New files.
* sysdeps/i386/strpbrk.S, sysdeps/i386/strrchr.S: New files.
* sysdeps/i386/strspn.S, sysdeps/i386/i486/strcat.S: New files.
* sysdeps/i386/i486/strlen.S, sysdeps/i386/i586/strchr.S: New files.
* sysdeps/i386/i586/strlen.S: New file.
* sysdeps/i386/memchr.c: Removed. There is now an assembler version.
* sysdeps/i386/i586/memcopy.h (WORD_COPY_BWD): Parameters did
not correspond to used values.
* sysdeps/unix/sysv/linux/nfs/nfs.h: New file. Simply a wrapper
around a kernel header file.
* sysdeps/unix/sysv/linux/Dist: Add it.
* sysdeps/unix/sysv/linux/Makefile [$(subdir)=sunrpc] (headers):
Likewise.
* sysdeps/unix/sysv/linux/local_lim.h: Rewrite. Instead of
defining ourself we use a kernel header file.
* sysdeps/unix/sysv/linux/i386/sysdep.h (DO_CALL): Optimize system
call handler for i586.
* sysdeps/unix/sysv/linux/sys/param.h: Add copyright and clean up.
1995-10-16 02:37:51 +01:00
|
|
|
/* Exactly like udiv_qrnnd_preinv, but branch-free. It is not clear which
|
|
|
|
version to use. */
|
1995-02-18 02:27:10 +01:00
|
|
|
#define udiv_qrnnd_preinv2norm(q, r, nh, nl, d, di) \
|
|
|
|
do { \
|
1996-05-07 23:04:52 +02:00
|
|
|
mp_limb_t n2, n10, n1, nadj, q1; \
|
|
|
|
mp_limb_t _xh, _xl; \
|
1995-02-18 02:27:10 +01:00
|
|
|
n2 = (nh); \
|
|
|
|
n10 = (nl); \
|
1996-05-07 23:04:52 +02:00
|
|
|
n1 = ((mp_limb_signed_t) n10 >> (BITS_PER_MP_LIMB - 1)); \
|
1995-02-18 02:27:10 +01:00
|
|
|
nadj = n10 + (n1 & (d)); \
|
|
|
|
umul_ppmm (_xh, _xl, di, n2 - n1); \
|
|
|
|
add_ssaaaa (_xh, _xl, _xh, _xl, 0, nadj); \
|
|
|
|
q1 = ~(n2 + _xh); \
|
|
|
|
umul_ppmm (_xh, _xl, q1, d); \
|
|
|
|
add_ssaaaa (_xh, _xl, _xh, _xl, nh, nl); \
|
|
|
|
_xh -= (d); \
|
|
|
|
(r) = _xl + ((d) & _xh); \
|
|
|
|
(q) = _xh - q1; \
|
|
|
|
} while (0)
|
|
|
|
|
|
|
|
#if defined (__GNUC__)
|
Sat Oct 14 02:52:36 1995 Ulrich Drepper <drepper@ipd.info.uni-karlsruhe.de>
* malloc/malloc.c (_malloc_internal): Performance fix. Move
if statement out of loop.
* stdio/_itoa.c, stdio/_itoa.h: Complete rewrite. Much faster
implementation using GMP functions. Contributed by
Torbjorn Granlund and Ulrich Drepper.
* stdio/test_rdwr.c: Include <errno.h>.
* sysdeps/i386/i586/Implies: New file.
New highly optimized string functions for i[345]86.
* sysdeps/i386/memchr.S, sysdeps/i386/memcmp.S: New files.
* sysdeps/i386/stpcpy.S, sysdeps/i386/stpncpy.S: New files.
* sysdeps/i386/strchr.S, sysdeps/i386/strcspn.S: New files.
* sysdeps/i386/strpbrk.S, sysdeps/i386/strrchr.S: New files.
* sysdeps/i386/strspn.S, sysdeps/i386/i486/strcat.S: New files.
* sysdeps/i386/i486/strlen.S, sysdeps/i386/i586/strchr.S: New files.
* sysdeps/i386/i586/strlen.S: New file.
* sysdeps/i386/memchr.c: Removed. There is now an assembler version.
* sysdeps/i386/i586/memcopy.h (WORD_COPY_BWD): Parameters did
not correspond to used values.
* sysdeps/unix/sysv/linux/nfs/nfs.h: New file. Simply a wrapper
around a kernel header file.
* sysdeps/unix/sysv/linux/Dist: Add it.
* sysdeps/unix/sysv/linux/Makefile [$(subdir)=sunrpc] (headers):
Likewise.
* sysdeps/unix/sysv/linux/local_lim.h: Rewrite. Instead of
defining ourself we use a kernel header file.
* sysdeps/unix/sysv/linux/i386/sysdep.h (DO_CALL): Optimize system
call handler for i586.
* sysdeps/unix/sysv/linux/sys/param.h: Add copyright and clean up.
Sat Oct 14 02:52:36 1995 Ulrich Drepper <drepper@ipd.info.uni-karlsruhe.de>
* malloc/malloc.c (_malloc_internal): Performance fix. Move
if statement out of loop.
* stdio/_itoa.c, stdio/_itoa.h: Complete rewrite. Much faster
implementation using GMP functions. Contributed by
Torbjorn Granlund and Ulrich Drepper.
* stdio/test_rdwr.c: Include <errno.h>.
* sysdeps/i386/i586/Implies: New file.
New highly optimized string functions for i[345]86.
* sysdeps/i386/memchr.S, sysdeps/i386/memcmp.S: New files.
* sysdeps/i386/stpcpy.S, sysdeps/i386/stpncpy.S: New files.
* sysdeps/i386/strchr.S, sysdeps/i386/strcspn.S: New files.
* sysdeps/i386/strpbrk.S, sysdeps/i386/strrchr.S: New files.
* sysdeps/i386/strspn.S, sysdeps/i386/i486/strcat.S: New files.
* sysdeps/i386/i486/strlen.S, sysdeps/i386/i586/strchr.S: New files.
* sysdeps/i386/i586/strlen.S: New file.
* sysdeps/i386/memchr.c: Removed. There is now an assembler version.
* sysdeps/i386/i586/memcopy.h (WORD_COPY_BWD): Parameters did
not correspond to used values.
* sysdeps/unix/sysv/linux/nfs/nfs.h: New file. Simply a wrapper
around a kernel header file.
* sysdeps/unix/sysv/linux/Dist: Add it.
* sysdeps/unix/sysv/linux/Makefile [$(subdir)=sunrpc] (headers):
Likewise.
* sysdeps/unix/sysv/linux/local_lim.h: Rewrite. Instead of
defining ourself we use a kernel header file.
* sysdeps/unix/sysv/linux/i386/sysdep.h (DO_CALL): Optimize system
call handler for i586.
* sysdeps/unix/sysv/linux/sys/param.h: Add copyright and clean up.
1995-10-16 02:37:51 +01:00
|
|
|
/* Define stuff for longlong.h. */
|
1995-02-18 02:27:10 +01:00
|
|
|
typedef unsigned int UQItype __attribute__ ((mode (QI)));
|
|
|
|
typedef int SItype __attribute__ ((mode (SI)));
|
|
|
|
typedef unsigned int USItype __attribute__ ((mode (SI)));
|
|
|
|
typedef int DItype __attribute__ ((mode (DI)));
|
|
|
|
typedef unsigned int UDItype __attribute__ ((mode (DI)));
|
Sat Oct 14 02:52:36 1995 Ulrich Drepper <drepper@ipd.info.uni-karlsruhe.de>
* malloc/malloc.c (_malloc_internal): Performance fix. Move
if statement out of loop.
* stdio/_itoa.c, stdio/_itoa.h: Complete rewrite. Much faster
implementation using GMP functions. Contributed by
Torbjorn Granlund and Ulrich Drepper.
* stdio/test_rdwr.c: Include <errno.h>.
* sysdeps/i386/i586/Implies: New file.
New highly optimized string functions for i[345]86.
* sysdeps/i386/memchr.S, sysdeps/i386/memcmp.S: New files.
* sysdeps/i386/stpcpy.S, sysdeps/i386/stpncpy.S: New files.
* sysdeps/i386/strchr.S, sysdeps/i386/strcspn.S: New files.
* sysdeps/i386/strpbrk.S, sysdeps/i386/strrchr.S: New files.
* sysdeps/i386/strspn.S, sysdeps/i386/i486/strcat.S: New files.
* sysdeps/i386/i486/strlen.S, sysdeps/i386/i586/strchr.S: New files.
* sysdeps/i386/i586/strlen.S: New file.
* sysdeps/i386/memchr.c: Removed. There is now an assembler version.
* sysdeps/i386/i586/memcopy.h (WORD_COPY_BWD): Parameters did
not correspond to used values.
* sysdeps/unix/sysv/linux/nfs/nfs.h: New file. Simply a wrapper
around a kernel header file.
* sysdeps/unix/sysv/linux/Dist: Add it.
* sysdeps/unix/sysv/linux/Makefile [$(subdir)=sunrpc] (headers):
Likewise.
* sysdeps/unix/sysv/linux/local_lim.h: Rewrite. Instead of
defining ourself we use a kernel header file.
* sysdeps/unix/sysv/linux/i386/sysdep.h (DO_CALL): Optimize system
call handler for i586.
* sysdeps/unix/sysv/linux/sys/param.h: Add copyright and clean up.
Sat Oct 14 02:52:36 1995 Ulrich Drepper <drepper@ipd.info.uni-karlsruhe.de>
* malloc/malloc.c (_malloc_internal): Performance fix. Move
if statement out of loop.
* stdio/_itoa.c, stdio/_itoa.h: Complete rewrite. Much faster
implementation using GMP functions. Contributed by
Torbjorn Granlund and Ulrich Drepper.
* stdio/test_rdwr.c: Include <errno.h>.
* sysdeps/i386/i586/Implies: New file.
New highly optimized string functions for i[345]86.
* sysdeps/i386/memchr.S, sysdeps/i386/memcmp.S: New files.
* sysdeps/i386/stpcpy.S, sysdeps/i386/stpncpy.S: New files.
* sysdeps/i386/strchr.S, sysdeps/i386/strcspn.S: New files.
* sysdeps/i386/strpbrk.S, sysdeps/i386/strrchr.S: New files.
* sysdeps/i386/strspn.S, sysdeps/i386/i486/strcat.S: New files.
* sysdeps/i386/i486/strlen.S, sysdeps/i386/i586/strchr.S: New files.
* sysdeps/i386/i586/strlen.S: New file.
* sysdeps/i386/memchr.c: Removed. There is now an assembler version.
* sysdeps/i386/i586/memcopy.h (WORD_COPY_BWD): Parameters did
not correspond to used values.
* sysdeps/unix/sysv/linux/nfs/nfs.h: New file. Simply a wrapper
around a kernel header file.
* sysdeps/unix/sysv/linux/Dist: Add it.
* sysdeps/unix/sysv/linux/Makefile [$(subdir)=sunrpc] (headers):
Likewise.
* sysdeps/unix/sysv/linux/local_lim.h: Rewrite. Instead of
defining ourself we use a kernel header file.
* sysdeps/unix/sysv/linux/i386/sysdep.h (DO_CALL): Optimize system
call handler for i586.
* sysdeps/unix/sysv/linux/sys/param.h: Add copyright and clean up.
1995-10-16 02:37:51 +01:00
|
|
|
#else
|
|
|
|
typedef unsigned char UQItype;
|
|
|
|
typedef long SItype;
|
|
|
|
typedef unsigned long USItype;
|
1995-02-18 02:27:10 +01:00
|
|
|
#endif
|
|
|
|
|
1996-05-07 23:04:52 +02:00
|
|
|
typedef mp_limb_t UWtype;
|
1995-02-18 02:27:10 +01:00
|
|
|
typedef unsigned int UHWtype;
|
|
|
|
#define W_TYPE_SIZE BITS_PER_MP_LIMB
|
Sat Oct 14 02:52:36 1995 Ulrich Drepper <drepper@ipd.info.uni-karlsruhe.de>
* malloc/malloc.c (_malloc_internal): Performance fix. Move
if statement out of loop.
* stdio/_itoa.c, stdio/_itoa.h: Complete rewrite. Much faster
implementation using GMP functions. Contributed by
Torbjorn Granlund and Ulrich Drepper.
* stdio/test_rdwr.c: Include <errno.h>.
* sysdeps/i386/i586/Implies: New file.
New highly optimized string functions for i[345]86.
* sysdeps/i386/memchr.S, sysdeps/i386/memcmp.S: New files.
* sysdeps/i386/stpcpy.S, sysdeps/i386/stpncpy.S: New files.
* sysdeps/i386/strchr.S, sysdeps/i386/strcspn.S: New files.
* sysdeps/i386/strpbrk.S, sysdeps/i386/strrchr.S: New files.
* sysdeps/i386/strspn.S, sysdeps/i386/i486/strcat.S: New files.
* sysdeps/i386/i486/strlen.S, sysdeps/i386/i586/strchr.S: New files.
* sysdeps/i386/i586/strlen.S: New file.
* sysdeps/i386/memchr.c: Removed. There is now an assembler version.
* sysdeps/i386/i586/memcopy.h (WORD_COPY_BWD): Parameters did
not correspond to used values.
* sysdeps/unix/sysv/linux/nfs/nfs.h: New file. Simply a wrapper
around a kernel header file.
* sysdeps/unix/sysv/linux/Dist: Add it.
* sysdeps/unix/sysv/linux/Makefile [$(subdir)=sunrpc] (headers):
Likewise.
* sysdeps/unix/sysv/linux/local_lim.h: Rewrite. Instead of
defining ourself we use a kernel header file.
* sysdeps/unix/sysv/linux/i386/sysdep.h (DO_CALL): Optimize system
call handler for i586.
* sysdeps/unix/sysv/linux/sys/param.h: Add copyright and clean up.
Sat Oct 14 02:52:36 1995 Ulrich Drepper <drepper@ipd.info.uni-karlsruhe.de>
* malloc/malloc.c (_malloc_internal): Performance fix. Move
if statement out of loop.
* stdio/_itoa.c, stdio/_itoa.h: Complete rewrite. Much faster
implementation using GMP functions. Contributed by
Torbjorn Granlund and Ulrich Drepper.
* stdio/test_rdwr.c: Include <errno.h>.
* sysdeps/i386/i586/Implies: New file.
New highly optimized string functions for i[345]86.
* sysdeps/i386/memchr.S, sysdeps/i386/memcmp.S: New files.
* sysdeps/i386/stpcpy.S, sysdeps/i386/stpncpy.S: New files.
* sysdeps/i386/strchr.S, sysdeps/i386/strcspn.S: New files.
* sysdeps/i386/strpbrk.S, sysdeps/i386/strrchr.S: New files.
* sysdeps/i386/strspn.S, sysdeps/i386/i486/strcat.S: New files.
* sysdeps/i386/i486/strlen.S, sysdeps/i386/i586/strchr.S: New files.
* sysdeps/i386/i586/strlen.S: New file.
* sysdeps/i386/memchr.c: Removed. There is now an assembler version.
* sysdeps/i386/i586/memcopy.h (WORD_COPY_BWD): Parameters did
not correspond to used values.
* sysdeps/unix/sysv/linux/nfs/nfs.h: New file. Simply a wrapper
around a kernel header file.
* sysdeps/unix/sysv/linux/Dist: Add it.
* sysdeps/unix/sysv/linux/Makefile [$(subdir)=sunrpc] (headers):
Likewise.
* sysdeps/unix/sysv/linux/local_lim.h: Rewrite. Instead of
defining ourself we use a kernel header file.
* sysdeps/unix/sysv/linux/i386/sysdep.h (DO_CALL): Optimize system
call handler for i586.
* sysdeps/unix/sysv/linux/sys/param.h: Add copyright and clean up.
1995-10-16 02:37:51 +01:00
|
|
|
|
1996-03-01 19:45:35 +01:00
|
|
|
/* Internal mpn calls */
|
|
|
|
#define impn_mul_n_basecase __MPN(impn_mul_n_basecase)
|
|
|
|
#define impn_mul_n __MPN(impn_mul_n)
|
|
|
|
#define impn_sqr_n_basecase __MPN(impn_sqr_n_basecase)
|
|
|
|
#define impn_sqr_n __MPN(impn_sqr_n)
|
Sat Oct 14 02:52:36 1995 Ulrich Drepper <drepper@ipd.info.uni-karlsruhe.de>
* malloc/malloc.c (_malloc_internal): Performance fix. Move
if statement out of loop.
* stdio/_itoa.c, stdio/_itoa.h: Complete rewrite. Much faster
implementation using GMP functions. Contributed by
Torbjorn Granlund and Ulrich Drepper.
* stdio/test_rdwr.c: Include <errno.h>.
* sysdeps/i386/i586/Implies: New file.
New highly optimized string functions for i[345]86.
* sysdeps/i386/memchr.S, sysdeps/i386/memcmp.S: New files.
* sysdeps/i386/stpcpy.S, sysdeps/i386/stpncpy.S: New files.
* sysdeps/i386/strchr.S, sysdeps/i386/strcspn.S: New files.
* sysdeps/i386/strpbrk.S, sysdeps/i386/strrchr.S: New files.
* sysdeps/i386/strspn.S, sysdeps/i386/i486/strcat.S: New files.
* sysdeps/i386/i486/strlen.S, sysdeps/i386/i586/strchr.S: New files.
* sysdeps/i386/i586/strlen.S: New file.
* sysdeps/i386/memchr.c: Removed. There is now an assembler version.
* sysdeps/i386/i586/memcopy.h (WORD_COPY_BWD): Parameters did
not correspond to used values.
* sysdeps/unix/sysv/linux/nfs/nfs.h: New file. Simply a wrapper
around a kernel header file.
* sysdeps/unix/sysv/linux/Dist: Add it.
* sysdeps/unix/sysv/linux/Makefile [$(subdir)=sunrpc] (headers):
Likewise.
* sysdeps/unix/sysv/linux/local_lim.h: Rewrite. Instead of
defining ourself we use a kernel header file.
* sysdeps/unix/sysv/linux/i386/sysdep.h (DO_CALL): Optimize system
call handler for i586.
* sysdeps/unix/sysv/linux/sys/param.h: Add copyright and clean up.
Sat Oct 14 02:52:36 1995 Ulrich Drepper <drepper@ipd.info.uni-karlsruhe.de>
* malloc/malloc.c (_malloc_internal): Performance fix. Move
if statement out of loop.
* stdio/_itoa.c, stdio/_itoa.h: Complete rewrite. Much faster
implementation using GMP functions. Contributed by
Torbjorn Granlund and Ulrich Drepper.
* stdio/test_rdwr.c: Include <errno.h>.
* sysdeps/i386/i586/Implies: New file.
New highly optimized string functions for i[345]86.
* sysdeps/i386/memchr.S, sysdeps/i386/memcmp.S: New files.
* sysdeps/i386/stpcpy.S, sysdeps/i386/stpncpy.S: New files.
* sysdeps/i386/strchr.S, sysdeps/i386/strcspn.S: New files.
* sysdeps/i386/strpbrk.S, sysdeps/i386/strrchr.S: New files.
* sysdeps/i386/strspn.S, sysdeps/i386/i486/strcat.S: New files.
* sysdeps/i386/i486/strlen.S, sysdeps/i386/i586/strchr.S: New files.
* sysdeps/i386/i586/strlen.S: New file.
* sysdeps/i386/memchr.c: Removed. There is now an assembler version.
* sysdeps/i386/i586/memcopy.h (WORD_COPY_BWD): Parameters did
not correspond to used values.
* sysdeps/unix/sysv/linux/nfs/nfs.h: New file. Simply a wrapper
around a kernel header file.
* sysdeps/unix/sysv/linux/Dist: Add it.
* sysdeps/unix/sysv/linux/Makefile [$(subdir)=sunrpc] (headers):
Likewise.
* sysdeps/unix/sysv/linux/local_lim.h: Rewrite. Instead of
defining ourself we use a kernel header file.
* sysdeps/unix/sysv/linux/i386/sysdep.h (DO_CALL): Optimize system
call handler for i586.
* sysdeps/unix/sysv/linux/sys/param.h: Add copyright and clean up.
1995-10-16 02:37:51 +01:00
|
|
|
|
1996-05-24 22:16:39 +02:00
|
|
|
#ifndef _PROTO
|
|
|
|
#if defined (__STDC__) || defined (__cplusplus)
|
|
|
|
#define _PROTO(x) x
|
|
|
|
#else
|
|
|
|
#define _PROTO(x) ()
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Prototypes for internal mpn calls. */
|
|
|
|
extern void impn_mul_n_basecase _PROTO ((mp_ptr prodp, mp_srcptr up,
|
|
|
|
mp_srcptr vp, mp_size_t size));
|
|
|
|
extern void impn_mul_n _PROTO ((mp_ptr prodp, mp_srcptr up, mp_srcptr vp,
|
|
|
|
mp_size_t size, mp_ptr tspace));
|
|
|
|
extern void impn_sqr_n_basecase _PROTO ((mp_ptr prodp, mp_srcptr up,
|
|
|
|
mp_size_t size));
|
|
|
|
extern void impn_sqr_n _PROTO ((mp_ptr prodp, mp_srcptr up, mp_size_t size,
|
|
|
|
mp_ptr tspace));
|
|
|
|
|
|
|
|
|
|
|
|
|
Sat Oct 14 02:52:36 1995 Ulrich Drepper <drepper@ipd.info.uni-karlsruhe.de>
* malloc/malloc.c (_malloc_internal): Performance fix. Move
if statement out of loop.
* stdio/_itoa.c, stdio/_itoa.h: Complete rewrite. Much faster
implementation using GMP functions. Contributed by
Torbjorn Granlund and Ulrich Drepper.
* stdio/test_rdwr.c: Include <errno.h>.
* sysdeps/i386/i586/Implies: New file.
New highly optimized string functions for i[345]86.
* sysdeps/i386/memchr.S, sysdeps/i386/memcmp.S: New files.
* sysdeps/i386/stpcpy.S, sysdeps/i386/stpncpy.S: New files.
* sysdeps/i386/strchr.S, sysdeps/i386/strcspn.S: New files.
* sysdeps/i386/strpbrk.S, sysdeps/i386/strrchr.S: New files.
* sysdeps/i386/strspn.S, sysdeps/i386/i486/strcat.S: New files.
* sysdeps/i386/i486/strlen.S, sysdeps/i386/i586/strchr.S: New files.
* sysdeps/i386/i586/strlen.S: New file.
* sysdeps/i386/memchr.c: Removed. There is now an assembler version.
* sysdeps/i386/i586/memcopy.h (WORD_COPY_BWD): Parameters did
not correspond to used values.
* sysdeps/unix/sysv/linux/nfs/nfs.h: New file. Simply a wrapper
around a kernel header file.
* sysdeps/unix/sysv/linux/Dist: Add it.
* sysdeps/unix/sysv/linux/Makefile [$(subdir)=sunrpc] (headers):
Likewise.
* sysdeps/unix/sysv/linux/local_lim.h: Rewrite. Instead of
defining ourself we use a kernel header file.
* sysdeps/unix/sysv/linux/i386/sysdep.h (DO_CALL): Optimize system
call handler for i586.
* sysdeps/unix/sysv/linux/sys/param.h: Add copyright and clean up.
Sat Oct 14 02:52:36 1995 Ulrich Drepper <drepper@ipd.info.uni-karlsruhe.de>
* malloc/malloc.c (_malloc_internal): Performance fix. Move
if statement out of loop.
* stdio/_itoa.c, stdio/_itoa.h: Complete rewrite. Much faster
implementation using GMP functions. Contributed by
Torbjorn Granlund and Ulrich Drepper.
* stdio/test_rdwr.c: Include <errno.h>.
* sysdeps/i386/i586/Implies: New file.
New highly optimized string functions for i[345]86.
* sysdeps/i386/memchr.S, sysdeps/i386/memcmp.S: New files.
* sysdeps/i386/stpcpy.S, sysdeps/i386/stpncpy.S: New files.
* sysdeps/i386/strchr.S, sysdeps/i386/strcspn.S: New files.
* sysdeps/i386/strpbrk.S, sysdeps/i386/strrchr.S: New files.
* sysdeps/i386/strspn.S, sysdeps/i386/i486/strcat.S: New files.
* sysdeps/i386/i486/strlen.S, sysdeps/i386/i586/strchr.S: New files.
* sysdeps/i386/i586/strlen.S: New file.
* sysdeps/i386/memchr.c: Removed. There is now an assembler version.
* sysdeps/i386/i586/memcopy.h (WORD_COPY_BWD): Parameters did
not correspond to used values.
* sysdeps/unix/sysv/linux/nfs/nfs.h: New file. Simply a wrapper
around a kernel header file.
* sysdeps/unix/sysv/linux/Dist: Add it.
* sysdeps/unix/sysv/linux/Makefile [$(subdir)=sunrpc] (headers):
Likewise.
* sysdeps/unix/sysv/linux/local_lim.h: Rewrite. Instead of
defining ourself we use a kernel header file.
* sysdeps/unix/sysv/linux/i386/sysdep.h (DO_CALL): Optimize system
call handler for i586.
* sysdeps/unix/sysv/linux/sys/param.h: Add copyright and clean up.
1995-10-16 02:37:51 +01:00
|
|
|
#ifndef IEEE_DOUBLE_BIG_ENDIAN
|
|
|
|
#define IEEE_DOUBLE_BIG_ENDIAN 1
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if IEEE_DOUBLE_BIG_ENDIAN
|
|
|
|
union ieee_double_extract
|
|
|
|
{
|
|
|
|
struct
|
|
|
|
{
|
1996-03-01 19:45:35 +01:00
|
|
|
unsigned int sig:1;
|
|
|
|
unsigned int exp:11;
|
|
|
|
unsigned int manh:20;
|
|
|
|
unsigned int manl:32;
|
Sat Oct 14 02:52:36 1995 Ulrich Drepper <drepper@ipd.info.uni-karlsruhe.de>
* malloc/malloc.c (_malloc_internal): Performance fix. Move
if statement out of loop.
* stdio/_itoa.c, stdio/_itoa.h: Complete rewrite. Much faster
implementation using GMP functions. Contributed by
Torbjorn Granlund and Ulrich Drepper.
* stdio/test_rdwr.c: Include <errno.h>.
* sysdeps/i386/i586/Implies: New file.
New highly optimized string functions for i[345]86.
* sysdeps/i386/memchr.S, sysdeps/i386/memcmp.S: New files.
* sysdeps/i386/stpcpy.S, sysdeps/i386/stpncpy.S: New files.
* sysdeps/i386/strchr.S, sysdeps/i386/strcspn.S: New files.
* sysdeps/i386/strpbrk.S, sysdeps/i386/strrchr.S: New files.
* sysdeps/i386/strspn.S, sysdeps/i386/i486/strcat.S: New files.
* sysdeps/i386/i486/strlen.S, sysdeps/i386/i586/strchr.S: New files.
* sysdeps/i386/i586/strlen.S: New file.
* sysdeps/i386/memchr.c: Removed. There is now an assembler version.
* sysdeps/i386/i586/memcopy.h (WORD_COPY_BWD): Parameters did
not correspond to used values.
* sysdeps/unix/sysv/linux/nfs/nfs.h: New file. Simply a wrapper
around a kernel header file.
* sysdeps/unix/sysv/linux/Dist: Add it.
* sysdeps/unix/sysv/linux/Makefile [$(subdir)=sunrpc] (headers):
Likewise.
* sysdeps/unix/sysv/linux/local_lim.h: Rewrite. Instead of
defining ourself we use a kernel header file.
* sysdeps/unix/sysv/linux/i386/sysdep.h (DO_CALL): Optimize system
call handler for i586.
* sysdeps/unix/sysv/linux/sys/param.h: Add copyright and clean up.
Sat Oct 14 02:52:36 1995 Ulrich Drepper <drepper@ipd.info.uni-karlsruhe.de>
* malloc/malloc.c (_malloc_internal): Performance fix. Move
if statement out of loop.
* stdio/_itoa.c, stdio/_itoa.h: Complete rewrite. Much faster
implementation using GMP functions. Contributed by
Torbjorn Granlund and Ulrich Drepper.
* stdio/test_rdwr.c: Include <errno.h>.
* sysdeps/i386/i586/Implies: New file.
New highly optimized string functions for i[345]86.
* sysdeps/i386/memchr.S, sysdeps/i386/memcmp.S: New files.
* sysdeps/i386/stpcpy.S, sysdeps/i386/stpncpy.S: New files.
* sysdeps/i386/strchr.S, sysdeps/i386/strcspn.S: New files.
* sysdeps/i386/strpbrk.S, sysdeps/i386/strrchr.S: New files.
* sysdeps/i386/strspn.S, sysdeps/i386/i486/strcat.S: New files.
* sysdeps/i386/i486/strlen.S, sysdeps/i386/i586/strchr.S: New files.
* sysdeps/i386/i586/strlen.S: New file.
* sysdeps/i386/memchr.c: Removed. There is now an assembler version.
* sysdeps/i386/i586/memcopy.h (WORD_COPY_BWD): Parameters did
not correspond to used values.
* sysdeps/unix/sysv/linux/nfs/nfs.h: New file. Simply a wrapper
around a kernel header file.
* sysdeps/unix/sysv/linux/Dist: Add it.
* sysdeps/unix/sysv/linux/Makefile [$(subdir)=sunrpc] (headers):
Likewise.
* sysdeps/unix/sysv/linux/local_lim.h: Rewrite. Instead of
defining ourself we use a kernel header file.
* sysdeps/unix/sysv/linux/i386/sysdep.h (DO_CALL): Optimize system
call handler for i586.
* sysdeps/unix/sysv/linux/sys/param.h: Add copyright and clean up.
1995-10-16 02:37:51 +01:00
|
|
|
} s;
|
|
|
|
double d;
|
|
|
|
};
|
|
|
|
#else
|
|
|
|
union ieee_double_extract
|
|
|
|
{
|
|
|
|
struct
|
|
|
|
{
|
1996-03-01 19:45:35 +01:00
|
|
|
unsigned int manl:32;
|
|
|
|
unsigned int manh:20;
|
|
|
|
unsigned int exp:11;
|
|
|
|
unsigned int sig:1;
|
Sat Oct 14 02:52:36 1995 Ulrich Drepper <drepper@ipd.info.uni-karlsruhe.de>
* malloc/malloc.c (_malloc_internal): Performance fix. Move
if statement out of loop.
* stdio/_itoa.c, stdio/_itoa.h: Complete rewrite. Much faster
implementation using GMP functions. Contributed by
Torbjorn Granlund and Ulrich Drepper.
* stdio/test_rdwr.c: Include <errno.h>.
* sysdeps/i386/i586/Implies: New file.
New highly optimized string functions for i[345]86.
* sysdeps/i386/memchr.S, sysdeps/i386/memcmp.S: New files.
* sysdeps/i386/stpcpy.S, sysdeps/i386/stpncpy.S: New files.
* sysdeps/i386/strchr.S, sysdeps/i386/strcspn.S: New files.
* sysdeps/i386/strpbrk.S, sysdeps/i386/strrchr.S: New files.
* sysdeps/i386/strspn.S, sysdeps/i386/i486/strcat.S: New files.
* sysdeps/i386/i486/strlen.S, sysdeps/i386/i586/strchr.S: New files.
* sysdeps/i386/i586/strlen.S: New file.
* sysdeps/i386/memchr.c: Removed. There is now an assembler version.
* sysdeps/i386/i586/memcopy.h (WORD_COPY_BWD): Parameters did
not correspond to used values.
* sysdeps/unix/sysv/linux/nfs/nfs.h: New file. Simply a wrapper
around a kernel header file.
* sysdeps/unix/sysv/linux/Dist: Add it.
* sysdeps/unix/sysv/linux/Makefile [$(subdir)=sunrpc] (headers):
Likewise.
* sysdeps/unix/sysv/linux/local_lim.h: Rewrite. Instead of
defining ourself we use a kernel header file.
* sysdeps/unix/sysv/linux/i386/sysdep.h (DO_CALL): Optimize system
call handler for i586.
* sysdeps/unix/sysv/linux/sys/param.h: Add copyright and clean up.
Sat Oct 14 02:52:36 1995 Ulrich Drepper <drepper@ipd.info.uni-karlsruhe.de>
* malloc/malloc.c (_malloc_internal): Performance fix. Move
if statement out of loop.
* stdio/_itoa.c, stdio/_itoa.h: Complete rewrite. Much faster
implementation using GMP functions. Contributed by
Torbjorn Granlund and Ulrich Drepper.
* stdio/test_rdwr.c: Include <errno.h>.
* sysdeps/i386/i586/Implies: New file.
New highly optimized string functions for i[345]86.
* sysdeps/i386/memchr.S, sysdeps/i386/memcmp.S: New files.
* sysdeps/i386/stpcpy.S, sysdeps/i386/stpncpy.S: New files.
* sysdeps/i386/strchr.S, sysdeps/i386/strcspn.S: New files.
* sysdeps/i386/strpbrk.S, sysdeps/i386/strrchr.S: New files.
* sysdeps/i386/strspn.S, sysdeps/i386/i486/strcat.S: New files.
* sysdeps/i386/i486/strlen.S, sysdeps/i386/i586/strchr.S: New files.
* sysdeps/i386/i586/strlen.S: New file.
* sysdeps/i386/memchr.c: Removed. There is now an assembler version.
* sysdeps/i386/i586/memcopy.h (WORD_COPY_BWD): Parameters did
not correspond to used values.
* sysdeps/unix/sysv/linux/nfs/nfs.h: New file. Simply a wrapper
around a kernel header file.
* sysdeps/unix/sysv/linux/Dist: Add it.
* sysdeps/unix/sysv/linux/Makefile [$(subdir)=sunrpc] (headers):
Likewise.
* sysdeps/unix/sysv/linux/local_lim.h: Rewrite. Instead of
defining ourself we use a kernel header file.
* sysdeps/unix/sysv/linux/i386/sysdep.h (DO_CALL): Optimize system
call handler for i586.
* sysdeps/unix/sysv/linux/sys/param.h: Add copyright and clean up.
1995-10-16 02:37:51 +01:00
|
|
|
} s;
|
|
|
|
double d;
|
|
|
|
};
|
|
|
|
#endif
|