Quellcodebibliothek Statistik Leitseite products/sources/formale Sprachen/GAP/extern/gmp/   (Algebra von RWTH Aachen Version 4.15.1©)  Datei vom 18.9.2025 mit Größe 179 kB image not shown  

Quelle  gmp-impl.h   Sprache: C

 
/* Include file for internal GNU MP types and definitions.

   THE CONTENTS OF THIS FILE ARE FOR INTERNAL USE AND ARE ALMOST CERTAIN TO
   BE SUBJECT TO INCOMPATIBLE CHANGES IN FUTURE GNU MP RELEASES.

Copyright 1991-2018, 2021, 2022 Free Software Foundation, Inc.

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 either:

  * the GNU Lesser General Public License as published by the Free
    Software Foundation; either version 3 of the License, or (at your
    option) any later version.

or

  * the GNU General Public License as published by the Free Software
    Foundation; either version 2 of the License, or (at your option) any
    later version.

or both in parallel, as here.

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 General Public License
for more details.

You should have received copies of the GNU General Public License and the
GNU Lesser General Public License along with the GNU MP Library.  If not,
see https://www.gnu.org/licenses/.  */



/* __GMP_DECLSPEC must be given on any global data that will be accessed
   from outside libgmp, meaning from the test or development programs, or
   from libgmpxx.  Failing to do this will result in an incorrect address
   being used for the accesses.  On functions __GMP_DECLSPEC makes calls
   from outside libgmp more efficient, but they'll still work fine without
   it.  */



#ifndef __GMP_IMPL_H__
#define __GMP_IMPL_H__

#if defined _CRAY
#include <intrinsics.h>  /* for _popcnt */
#endif

/* For INT_MAX, etc. We used to avoid it because of a bug (on solaris,
   gcc 2.95 under -mcpu=ultrasparc in ABI=32 ends up getting wrong
   values (the ABI=64 values)), but it should be safe now.

   On Cray vector systems, however, we need the system limits.h since sizes
   of signed and unsigned types can differ there, depending on compiler
   options (eg. -hnofastmd), making our SHRT_MAX etc expressions fail.  For
   reference, int can be 46 or 64 bits, whereas uint is always 64 bits; and
   short can be 24, 32, 46 or 64 bits, and different for ushort.  */


#include <limits.h>

/* For fat.h and other fat binary stuff.
   No need for __GMP_ATTRIBUTE_PURE or __GMP_NOTHROW, since functions
   declared this way are only used to set function pointers in __gmpn_cpuvec,
   they're not called directly.  */

#define DECL_add_n(name) \
  __GMP_DECLSPEC mp_limb_t name (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t)
#define DECL_addlsh1_n(name) \
  DECL_add_n (name)
#define DECL_addlsh2_n(name) \
  DECL_add_n (name)
#define DECL_addmul_1(name) \
  __GMP_DECLSPEC mp_limb_t name (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t)
#define DECL_addmul_2(name) \
  __GMP_DECLSPEC mp_limb_t name (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr)
#define DECL_bdiv_dbm1c(name) \
  __GMP_DECLSPEC mp_limb_t name (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t, mp_limb_t)
#define DECL_cnd_add_n(name) \
  __GMP_DECLSPEC mp_limb_t name (mp_limb_t, mp_ptr, mp_srcptr, mp_srcptr, mp_size_t)
#define DECL_cnd_sub_n(name) \
  __GMP_DECLSPEC mp_limb_t name (mp_limb_t, mp_ptr, mp_srcptr, mp_srcptr, mp_size_t)
#define DECL_com(name) \
  __GMP_DECLSPEC void name (mp_ptr, mp_srcptr, mp_size_t)
#define DECL_copyd(name) \
  __GMP_DECLSPEC void name (mp_ptr, mp_srcptr, mp_size_t)
#define DECL_copyi(name) \
  DECL_copyd (name)
#define DECL_divexact_1(name) \
  __GMP_DECLSPEC void name (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t)
#define DECL_divexact_by3c(name) \
  __GMP_DECLSPEC mp_limb_t name (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t)
#define DECL_divrem_1(name) \
  __GMP_DECLSPEC mp_limb_t name (mp_ptr, mp_size_t, mp_srcptr, mp_size_t, mp_limb_t)
#define DECL_gcd_11(name) \
  __GMP_DECLSPEC mp_limb_t name (mp_limb_t, mp_limb_t)
#define DECL_lshift(name) \
  __GMP_DECLSPEC mp_limb_t name (mp_ptr, mp_srcptr, mp_size_t, unsigned)
#define DECL_lshiftc(name) \
  DECL_lshift (name)
#define DECL_mod_1(name) \
  __GMP_DECLSPEC mp_limb_t name (mp_srcptr, mp_size_t, mp_limb_t)
#define DECL_mod_1_1p(name) \
  __GMP_DECLSPEC mp_limb_t name (mp_srcptr, mp_size_t, mp_limb_t, const mp_limb_t [])
#define DECL_mod_1_1p_cps(name) \
  __GMP_DECLSPEC void name (mp_limb_t cps[], mp_limb_t b)
#define DECL_mod_1s_2p(name) \
  DECL_mod_1_1p (name)
#define DECL_mod_1s_2p_cps(name) \
  DECL_mod_1_1p_cps (name)
#define DECL_mod_1s_4p(name) \
  DECL_mod_1_1p (name)
#define DECL_mod_1s_4p_cps(name) \
  DECL_mod_1_1p_cps (name)
#define DECL_mod_34lsub1(name) \
  __GMP_DECLSPEC mp_limb_t name (mp_srcptr, mp_size_t)
#define DECL_modexact_1c_odd(name) \
  __GMP_DECLSPEC mp_limb_t name (mp_srcptr, mp_size_t, mp_limb_t, mp_limb_t)
#define DECL_mul_1(name) \
  DECL_addmul_1 (name)
#define DECL_mul_basecase(name) \
  __GMP_DECLSPEC void name (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t)
#define DECL_mullo_basecase(name) \
  __GMP_DECLSPEC void name (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t)
#define DECL_preinv_divrem_1(name) \
  __GMP_DECLSPEC mp_limb_t name (mp_ptr, mp_size_t, mp_srcptr, mp_size_t, mp_limb_t, mp_limb_t, int)
#define DECL_preinv_mod_1(name) \
  __GMP_DECLSPEC mp_limb_t name (mp_srcptr, mp_size_t, mp_limb_t, mp_limb_t)
#define DECL_redc_1(name) \
  __GMP_DECLSPEC mp_limb_t name (mp_ptr, mp_ptr, mp_srcptr, mp_size_t, mp_limb_t)
#define DECL_redc_2(name) \
  __GMP_DECLSPEC mp_limb_t name (mp_ptr, mp_ptr, mp_srcptr, mp_size_t, mp_srcptr)
#define DECL_rshift(name) \
  DECL_lshift (name)
#define DECL_sqr_basecase(name) \
  __GMP_DECLSPEC void name (mp_ptr, mp_srcptr, mp_size_t)
#define DECL_sub_n(name) \
  DECL_add_n (name)
#define DECL_sublsh1_n(name) \
  DECL_add_n (name)
#define DECL_submul_1(name) \
  DECL_addmul_1 (name)

#if ! defined (__GMP_WITHIN_CONFIGURE)
#include "config.h"
#include "gmp.h"
#include "gmp-mparam.h"
#include "fib_table.h"
#include "fac_table.h"
#include "sieve_table.h"
#include "mp_bases.h"
#if WANT_FAT_BINARY
#include "fat.h"
#endif
#endif

#if HAVE_INTTYPES_H      /* for uint_least32_t */
include <inttypes.h>
#endif
/* On some platforms inttypes.h exists but is incomplete
   and we still need stdint.h. */

#if HAVE_STDINT_H
include <stdint.h>
#endif

#ifdef __cplusplus
#include <cstring>  /* for strlen */
#include <string>   /* for std::string */
#endif


#ifndef WANT_TMP_DEBUG  /* for TMP_ALLOC_LIMBS_2 and others */
#define WANT_TMP_DEBUG 0
#endif

/* The following tries to get a good version of alloca.  The tests are
   adapted from autoconf AC_FUNC_ALLOCA, with a couple of additions.
   Whether this succeeds is tested by GMP_FUNC_ALLOCA and HAVE_ALLOCA will
   be setup appropriately.

   ifndef alloca - a cpp define might already exist.
       glibc <stdlib.h> includes <alloca.h> which uses GCC __builtin_alloca.
       HP cc +Olibcalls adds a #define of alloca to __builtin_alloca.

   GCC __builtin_alloca - preferred whenever available.

   _AIX pragma - IBM compilers need a #pragma in "each module that needs to
       use alloca".  Pragma indented to protect pre-ANSI cpp's.  _IBMR2 was
       used in past versions of GMP, retained still in case it matters.

       The autoconf manual says this pragma needs to be at the start of a C
       file, apart from comments and preprocessor directives.  Is that true?
       xlc on aix 4.xxx doesn't seem to mind it being after prototypes etc
       from gmp.h.
*/


#ifndef alloca
ifdef __GNUC__
#  define alloca __builtin_alloca
else
#  ifdef __DECC
#   define alloca(x) __ALLOCA(x)
#  else
#   ifdef _MSC_VER
#    include <malloc.h>
#    define alloca _alloca
#   else
#    if HAVE_ALLOCA_H
#     include <alloca.h>
#    else
#     if defined (_AIX) || defined (_IBMR2)
 #pragma alloca
#     else
       char *alloca ();
#     endif
#    endif
#   endif
#  endif
endif
#endif


/* if not provided by gmp-mparam.h */
#ifndef GMP_LIMB_BYTES
#define GMP_LIMB_BYTES  SIZEOF_MP_LIMB_T
#endif
#ifndef GMP_LIMB_BITS
#define GMP_LIMB_BITS  (8 * SIZEOF_MP_LIMB_T)
#endif

#define BITS_PER_ULONG  (8 * SIZEOF_UNSIGNED_LONG)


/* gmp_uint_least32_t is an unsigned integer type with at least 32 bits. */
#if HAVE_UINT_LEAST32_T
typedef uint_least32_t      gmp_uint_least32_t;
#else
#if SIZEOF_UNSIGNED_SHORT >= 4
typedef unsigned short      gmp_uint_least32_t;
#else
#if SIZEOF_UNSIGNED >= 4
typedef unsigned            gmp_uint_least32_t;
#else
typedef unsigned long       gmp_uint_least32_t;
#endif
#endif
#endif


/* gmp_intptr_t, for pointer to integer casts */
#if HAVE_INTPTR_T
typedef intptr_t            gmp_intptr_t;
#else /* fallback */
typedef size_t              gmp_intptr_t;
#endif


/* pre-inverse types for truncating division and modulo */
typedef struct {mp_limb_t inv32;} gmp_pi1_t;
typedef struct {mp_limb_t inv21, inv32, inv53;} gmp_pi2_t;


/* "const" basically means a function does nothing but examine its arguments
   and give a return value, it doesn't read or write any memory (neither
   global nor pointed to by arguments), and has no other side-effects.  This
   is more restrictive than "pure".  See info node "(gcc)Function
   Attributes".  __GMP_NO_ATTRIBUTE_CONST_PURE lets tune/common.c etc turn
   this off when trying to write timing loops.  */

#if HAVE_ATTRIBUTE_CONST && ! defined (__GMP_NO_ATTRIBUTE_CONST_PURE)
#define ATTRIBUTE_CONST  __attribute__ ((const))
#else
#define ATTRIBUTE_CONST
#endif

#if HAVE_ATTRIBUTE_NORETURN
#define ATTRIBUTE_NORETURN  __attribute__ ((noreturn))
#else
#define ATTRIBUTE_NORETURN
#endif

/* "malloc" means a function behaves like malloc in that the pointer it
   returns doesn't alias anything.  */

#if HAVE_ATTRIBUTE_MALLOC
#define ATTRIBUTE_MALLOC  __attribute__ ((malloc))
#else
#define ATTRIBUTE_MALLOC
#endif


#if ! HAVE_STRCHR
#define strchr(s,c)  index(s,c)
#endif

#if ! HAVE_MEMSET
#define memset(p, c, n)   \
  do {     \
    ASSERT ((n) >= 0);   \
    char *__memset__p = (p);  \
    int  __i;    \
    for (__i = 0; __i < (n); __i++) \
      __memset__p[__i] = (c);  \
  } while (0)
#endif

/* va_copy is standard in C99, and gcc provides __va_copy when in strict C89
   mode.  Falling back to a memcpy will give maximum portability, since it
   works no matter whether va_list is a pointer, struct or array.  */

#if ! defined (va_copy) && defined (__va_copy)
#define va_copy(dst,src)  __va_copy(dst,src)
#endif
#if ! defined (va_copy)
#define va_copy(dst,src) \
  do { memcpy (&(dst), &(src), sizeof (va_list)); } while (0)
#endif


/* HAVE_HOST_CPU_alpha_CIX is 1 on an alpha with the CIX instructions
   (ie. ctlz, ctpop, cttz).  */

#if HAVE_HOST_CPU_alphaev67 || HAVE_HOST_CPU_alphaev68  \
  || HAVE_HOST_CPU_alphaev7
#define HAVE_HOST_CPU_alpha_CIX 1
#endif


#if defined (__cplusplus)
extern "C" {
#endif


/* Usage: TMP_DECL;
  TMP_MARK;
  ptr = TMP_ALLOC (bytes);
  TMP_FREE;

   Small allocations should use TMP_SALLOC, big allocations should use
   TMP_BALLOC.  Allocations that might be small or big should use TMP_ALLOC.

   Functions that use just TMP_SALLOC should use TMP_SDECL, TMP_SMARK, and
   TMP_SFREE.

   TMP_DECL just declares a variable, but might be empty and so must be last
   in a list of variables.  TMP_MARK must be done before any TMP_ALLOC.
   TMP_ALLOC(0) is not allowed.  TMP_FREE doesn't need to be done if a
   TMP_MARK was made, but then no TMP_ALLOCs.  */


/* The alignment in bytes, used for TMP_ALLOCed blocks, when alloca or
   __gmp_allocate_func doesn't already determine it.  */

union tmp_align_t {
  mp_limb_t  l;
  double     d;
  char       *p;
};
#define __TMP_ALIGN  sizeof (union tmp_align_t)

/* Return "a" rounded upwards to a multiple of "m", if it isn't already.
   "a" must be an unsigned type.
   This is designed for use with a compile-time constant "m".
   The POW2 case is expected to be usual, and gcc 3.0 and up recognises
   "(-(8*n))%8" or the like is always zero, which means the rounding up in
   the WANT_TMP_NOTREENTRANT version of TMP_ALLOC below will be a noop.  */

#define ROUND_UP_MULTIPLE(a,m)          \
  (POW2_P(m) ? (a) + (-(a))%(m)         \
   : (a)+(m)-1 - (((a)+(m)-1) % (m)))

#if defined (WANT_TMP_ALLOCA) || defined (WANT_TMP_REENTRANT)
struct tmp_reentrant_t {
  struct tmp_reentrant_t  *next;
  size_t    size;   /* bytes, including header */
};
__GMP_DECLSPEC void *__gmp_tmp_reentrant_alloc (struct tmp_reentrant_t **, size_t) ATTRIBUTE_MALLOC;
__GMP_DECLSPEC void  __gmp_tmp_reentrant_free (struct tmp_reentrant_t *);
#endif

#if WANT_TMP_ALLOCA
#define TMP_SDECL
#define TMP_DECL  struct tmp_reentrant_t *__tmp_marker
#define TMP_SMARK
#define TMP_MARK  __tmp_marker = 0
#define TMP_SALLOC(n)  alloca(n)
#define TMP_BALLOC(n)  __gmp_tmp_reentrant_alloc (&__tmp_marker, n)
/* The peculiar stack allocation limit here is chosen for efficient asm.  */
#define TMP_ALLOC(n)       \
  (LIKELY ((n) <= 0x7f00) ? TMP_SALLOC(n) : TMP_BALLOC(n))
#define TMP_SFREE
#define TMP_FREE       \
  do {         \
    if (UNLIKELY (__tmp_marker != 0))     \
      __gmp_tmp_reentrant_free (__tmp_marker);    \
  } while (0)
#endif

#if WANT_TMP_REENTRANT
#define TMP_SDECL  TMP_DECL
#define TMP_DECL  struct tmp_reentrant_t *__tmp_marker
#define TMP_SMARK  TMP_MARK
#define TMP_MARK  __tmp_marker = 0
#define TMP_SALLOC(n)  TMP_ALLOC(n)
#define TMP_BALLOC(n)  TMP_ALLOC(n)
#define TMP_ALLOC(n)  __gmp_tmp_reentrant_alloc (&__tmp_marker, n)
#define TMP_SFREE  TMP_FREE
#define TMP_FREE  __gmp_tmp_reentrant_free (__tmp_marker)
#endif

#if WANT_TMP_NOTREENTRANT
struct tmp_marker
{
  struct tmp_stack *which_chunk;
  void *alloc_point;
};
__GMP_DECLSPEC void *__gmp_tmp_alloc (unsigned long) ATTRIBUTE_MALLOC;
__GMP_DECLSPEC void __gmp_tmp_mark (struct tmp_marker *);
__GMP_DECLSPEC void __gmp_tmp_free (struct tmp_marker *);
#define TMP_SDECL  TMP_DECL
#define TMP_DECL  struct tmp_marker __tmp_marker
#define TMP_SMARK  TMP_MARK
#define TMP_MARK  __gmp_tmp_mark (&__tmp_marker)
#define TMP_SALLOC(n)  TMP_ALLOC(n)
#define TMP_BALLOC(n)  TMP_ALLOC(n)
#define TMP_ALLOC(n)       \
  __gmp_tmp_alloc (ROUND_UP_MULTIPLE ((unsigned long) (n), __TMP_ALIGN))
#define TMP_SFREE  TMP_FREE
#define TMP_FREE  __gmp_tmp_free (&__tmp_marker)
#endif

#if WANT_TMP_DEBUG
/* See tal-debug.c for some comments. */
struct tmp_debug_t {
  struct tmp_debug_entry_t  *list;
  const char                *file;
  int                       line;
};
struct tmp_debug_entry_t {
  struct tmp_debug_entry_t  *next;
  void                      *block;
  size_t                    size;
};
__GMP_DECLSPEC void  __gmp_tmp_debug_mark (const char *, intstruct tmp_debug_t **,
        struct tmp_debug_t *,
        const char *, const char *);
__GMP_DECLSPEC void *__gmp_tmp_debug_alloc (const char *, intint,
         struct tmp_debug_t **, const char *,
         size_t) ATTRIBUTE_MALLOC;
__GMP_DECLSPEC void  __gmp_tmp_debug_free (const char *, intint,
        struct tmp_debug_t **,
        const char *, const char *);
#define TMP_SDECL TMP_DECL_NAME(__tmp_xmarker, "__tmp_marker")
#define TMP_DECL TMP_DECL_NAME(__tmp_xmarker, "__tmp_marker")
#define TMP_SMARK TMP_MARK_NAME(__tmp_xmarker, "__tmp_marker")
#define TMP_MARK TMP_MARK_NAME(__tmp_xmarker, "__tmp_marker")
#define TMP_SFREE TMP_FREE_NAME(__tmp_xmarker, "__tmp_marker")
#define TMP_FREE TMP_FREE_NAME(__tmp_xmarker, "__tmp_marker")
/* The marker variable is designed to provoke an uninitialized variable
   warning from the compiler if TMP_FREE is used without a TMP_MARK.
   __tmp_marker_inscope does the same for TMP_ALLOC.  Runtime tests pick
   these things up too.  */

#define TMP_DECL_NAME(marker, marker_name)    \
  int marker;        \
  int __tmp_marker_inscope;      \
  const char *__tmp_marker_name = marker_name;    \
  struct tmp_debug_t  __tmp_marker_struct;    \
  /* don't demand NULL, just cast a zero */ \
  struct tmp_debug_t  *__tmp_marker = (struct tmp_debug_t *) 0
#define TMP_MARK_NAME(marker, marker_name)    \
  do {         \
    marker = 1;        \
    __tmp_marker_inscope = 1;      \
    __gmp_tmp_debug_mark  (ASSERT_FILE, ASSERT_LINE,   \
      &__tmp_marker, &__tmp_marker_struct,  \
      __tmp_marker_name, marker_name);  \
  } while (0)
#define TMP_SALLOC(n)  TMP_ALLOC(n)
#define TMP_BALLOC(n)  TMP_ALLOC(n)
#define TMP_ALLOC(size)       \
  __gmp_tmp_debug_alloc (ASSERT_FILE, ASSERT_LINE,   \
    __tmp_marker_inscope,    \
    &__tmp_marker, __tmp_marker_name, size)
#define TMP_FREE_NAME(marker, marker_name)    \
  do {         \
    __gmp_tmp_debug_free  (ASSERT_FILE, ASSERT_LINE,   \
      marker, &__tmp_marker,   \
      __tmp_marker_name, marker_name);  \
  } while (0)
#endif /* WANT_TMP_DEBUG */


/* Allocating various types. */
#define TMP_ALLOC_TYPE(n,type)  ((type *) TMP_ALLOC ((n) * sizeof (type)))
#define TMP_SALLOC_TYPE(n,type) ((type *) TMP_SALLOC ((n) * sizeof (type)))
#define TMP_BALLOC_TYPE(n,type) ((type *) TMP_BALLOC ((n) * sizeof (type)))
#define TMP_ALLOC_LIMBS(n)      TMP_ALLOC_TYPE(n,mp_limb_t)
#define TMP_SALLOC_LIMBS(n)     TMP_SALLOC_TYPE(n,mp_limb_t)
#define TMP_BALLOC_LIMBS(n)     TMP_BALLOC_TYPE(n,mp_limb_t)
#define TMP_ALLOC_MP_PTRS(n)    TMP_ALLOC_TYPE(n,mp_ptr)
#define TMP_SALLOC_MP_PTRS(n)   TMP_SALLOC_TYPE(n,mp_ptr)
#define TMP_BALLOC_MP_PTRS(n)   TMP_BALLOC_TYPE(n,mp_ptr)

/* It's more efficient to allocate one block than many.  This is certainly
   true of the malloc methods, but it can even be true of alloca if that
   involves copying a chunk of stack (various RISCs), or a call to a stack
   bounds check (mingw).  In any case, when debugging keep separate blocks
   so a redzoning malloc debugger can protect each individually.  */

#define TMP_ALLOC_LIMBS_2(xp,xsize, yp,ysize)    \
  do {         \
    if (WANT_TMP_DEBUG)       \
      {         \
 (xp) = TMP_ALLOC_LIMBS (xsize);     \
 (yp) = TMP_ALLOC_LIMBS (ysize);     \
      }         \
    else        \
      {         \
 (xp) = TMP_ALLOC_LIMBS ((xsize) + (ysize));   \
 (yp) = (xp) + (xsize);      \
      }         \
  } while (0)
#define TMP_ALLOC_LIMBS_3(xp,xsize, yp,ysize, zp,zsize)   \
  do {         \
    if (WANT_TMP_DEBUG)       \
      {         \
 (xp) = TMP_ALLOC_LIMBS (xsize);     \
 (yp) = TMP_ALLOC_LIMBS (ysize);     \
 (zp) = TMP_ALLOC_LIMBS (zsize);     \
      }         \
    else        \
      {         \
 (xp) = TMP_ALLOC_LIMBS ((xsize) + (ysize) + (zsize));  \
 (yp) = (xp) + (xsize);      \
 (zp) = (yp) + (ysize);      \
      }         \
  } while (0)

/* From gmp.h, nicer names for internal use. */
#define CRAY_Pragma(str)               __GMP_CRAY_Pragma(str)
#define MPN_CMP(result, xp, yp, size)  __GMPN_CMP(result, xp, yp, size)
#define LIKELY(cond)                   __GMP_LIKELY(cond)
#define UNLIKELY(cond)                 __GMP_UNLIKELY(cond)

#define ABS(x) ((x) >= 0 ? (x) : -(x))
#define NEG_CAST(T,x) (- (__GMP_CAST (T, (x) + 1) - 1))
#define ABS_CAST(T,x) ((x) >= 0 ? __GMP_CAST (T, x) : NEG_CAST (T,x))
#undef MIN
#define MIN(l,o) ((l) < (o) ? (l) : (o))
#undef MAX
#define MAX(h,i) ((h) > (i) ? (h) : (i))
#define numberof(x)  (sizeof (x) / sizeof ((x)[0]))

/* 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)
#define NUM(x) mpq_numref(x)
#define DEN(x) mpq_denref(x)

/* n-1 inverts any low zeros and the lowest one bit.  If n&(n-1) leaves zero
   then that lowest one bit must have been the only bit set.  n==0 will
   return true though, so avoid that.  */

#define POW2_P(n)  (((n) & ((n) - 1)) == 0)

/* This is intended for constant THRESHOLDs only, where the compiler
   can completely fold the result.  */

#define LOG2C(n) \
 (((n) >=    0x1) + ((n) >=    0x2) + ((n) >=    0x4) + ((n) >=    0x8) + \
  ((n) >=   0x10) + ((n) >=   0x20) + ((n) >=   0x40) + ((n) >=   0x80) + \
  ((n) >=  0x100) + ((n) >=  0x200) + ((n) >=  0x400) + ((n) >=  0x800) + \
  ((n) >= 0x1000) + ((n) >= 0x2000) + ((n) >= 0x4000) + ((n) >= 0x8000))

#define MP_LIMB_T_MAX      (~ (mp_limb_t) 0)

/* Must cast ULONG_MAX etc to unsigned long etc, since they might not be
   unsigned on a K&R compiler.  In particular the HP-UX 10 bundled K&R cc
   treats the plain decimal values in <limits.h> as signed.  */

#define ULONG_HIGHBIT      (ULONG_MAX ^ ((unsigned long) ULONG_MAX >> 1))
#define UINT_HIGHBIT       (UINT_MAX ^ ((unsigned) UINT_MAX >> 1))
#define USHRT_HIGHBIT      (USHRT_MAX ^ ((unsigned short) USHRT_MAX >> 1))
#define GMP_LIMB_HIGHBIT  (MP_LIMB_T_MAX ^ (MP_LIMB_T_MAX >> 1))

#if __GMP_MP_SIZE_T_INT
#define MP_SIZE_T_MAX      INT_MAX
#define MP_SIZE_T_MIN      INT_MIN
#else
#define MP_SIZE_T_MAX      LONG_MAX
#define MP_SIZE_T_MIN      LONG_MIN
#endif

/* mp_exp_t is the same as mp_size_t */
#define MP_EXP_T_MAX   MP_SIZE_T_MAX
#define MP_EXP_T_MIN   MP_SIZE_T_MIN

#define LONG_HIGHBIT       LONG_MIN
#define INT_HIGHBIT        INT_MIN
#define SHRT_HIGHBIT       SHRT_MIN


#define GMP_NUMB_HIGHBIT  (CNST_LIMB(1) << (GMP_NUMB_BITS-1))

#if GMP_NAIL_BITS == 0
#define GMP_NAIL_LOWBIT   CNST_LIMB(0)
#else
#define GMP_NAIL_LOWBIT   (CNST_LIMB(1) << GMP_NUMB_BITS)
#endif

#if GMP_NAIL_BITS != 0
/* Set various *_THRESHOLD values to be used for nails.  Thus we avoid using
   code that has not yet been qualified.  */


#undef  DC_DIV_QR_THRESHOLD
#define DC_DIV_QR_THRESHOLD              50

#undef DIVREM_1_NORM_THRESHOLD
#undef DIVREM_1_UNNORM_THRESHOLD
#undef MOD_1_NORM_THRESHOLD
#undef MOD_1_UNNORM_THRESHOLD
#undef USE_PREINV_DIVREM_1
#undef DIVREM_2_THRESHOLD
#undef DIVEXACT_1_THRESHOLD
#define DIVREM_1_NORM_THRESHOLD           MP_SIZE_T_MAX  /* no preinv */
#define DIVREM_1_UNNORM_THRESHOLD         MP_SIZE_T_MAX  /* no preinv */
#define MOD_1_NORM_THRESHOLD              MP_SIZE_T_MAX  /* no preinv */
#define MOD_1_UNNORM_THRESHOLD            MP_SIZE_T_MAX  /* no preinv */
#define USE_PREINV_DIVREM_1               0  /* no preinv */
#define DIVREM_2_THRESHOLD                MP_SIZE_T_MAX  /* no preinv */

/* mpn/generic/mul_fft.c is not nails-capable. */
#undef  MUL_FFT_THRESHOLD
#undef  SQR_FFT_THRESHOLD
#define MUL_FFT_THRESHOLD                MP_SIZE_T_MAX
#define SQR_FFT_THRESHOLD                MP_SIZE_T_MAX
#endif

/* Swap macros. */

#define MP_LIMB_T_SWAP(x, y)      \
  do {         \
    mp_limb_t __mp_limb_t_swap__tmp = (x);    \
    (x) = (y);        \
    (y) = __mp_limb_t_swap__tmp;     \
  } while (0)
#define MP_SIZE_T_SWAP(x, y)      \
  do {         \
    mp_size_t __mp_size_t_swap__tmp = (x);    \
    (x) = (y);        \
    (y) = __mp_size_t_swap__tmp;     \
  } while (0)

#define MP_PTR_SWAP(x, y)      \
  do {         \
    mp_ptr __mp_ptr_swap__tmp = (x);     \
    (x) = (y);        \
    (y) = __mp_ptr_swap__tmp;      \
  } while (0)
#define MP_SRCPTR_SWAP(x, y)      \
  do {         \
    mp_srcptr __mp_srcptr_swap__tmp = (x);    \
    (x) = (y);        \
    (y) = __mp_srcptr_swap__tmp;     \
  } while (0)

#define MPN_PTR_SWAP(xp,xs, yp,ys)     \
  do {         \
    MP_PTR_SWAP (xp, yp);      \
    MP_SIZE_T_SWAP (xs, ys);      \
  } while(0)
#define MPN_SRCPTR_SWAP(xp,xs, yp,ys)     \
  do {         \
    MP_SRCPTR_SWAP (xp, yp);      \
    MP_SIZE_T_SWAP (xs, ys);      \
  } while(0)

#define MPZ_PTR_SWAP(x, y)      \
  do {         \
    mpz_ptr __mpz_ptr_swap__tmp = (x);     \
    (x) = (y);        \
    (y) = __mpz_ptr_swap__tmp;      \
  } while (0)
#define MPZ_SRCPTR_SWAP(x, y)      \
  do {         \
    mpz_srcptr __mpz_srcptr_swap__tmp = (x);    \
    (x) = (y);        \
    (y) = __mpz_srcptr_swap__tmp;     \
  } while (0)

#define MPQ_PTR_SWAP(x, y)      \
  do {                                                                  \
    mpq_ptr __mpq_ptr_swap__tmp = (x);     \
    (x) = (y);                                                          \
    (y) = __mpq_ptr_swap__tmp;      \
  } while (0)
#define MPQ_SRCPTR_SWAP(x, y)                                           \
  do {                                                                  \
    mpq_srcptr __mpq_srcptr_swap__tmp = (x);                            \
    (x) = (y);                                                          \
    (y) = __mpq_srcptr_swap__tmp;                                       \
  } while (0)


/* Enhancement: __gmp_allocate_func could have "__attribute__ ((malloc))",
   but current gcc (3.0) doesn't seem to support that.  */

__GMP_DECLSPEC extern void * (*__gmp_allocate_func) (size_t);
__GMP_DECLSPEC extern void * (*__gmp_reallocate_func) (void *, size_t, size_t);
__GMP_DECLSPEC extern void   (*__gmp_free_func) (void *, size_t);

__GMP_DECLSPEC void *__gmp_default_allocate (size_t);
__GMP_DECLSPEC void *__gmp_default_reallocate (void *, size_t, size_t);
__GMP_DECLSPEC void __gmp_default_free (void *, size_t);

#define __GMP_ALLOCATE_FUNC_TYPE(n,type) \
  ((type *) (*__gmp_allocate_func) ((n) * sizeof (type)))
#define __GMP_ALLOCATE_FUNC_LIMBS(n)   __GMP_ALLOCATE_FUNC_TYPE (n, mp_limb_t)

#define __GMP_REALLOCATE_FUNC_TYPE(p, old_size, new_size, type)  \
  ((type *) (*__gmp_reallocate_func)     \
   (p, (old_size) * sizeof (type), (new_size) * sizeof (type)))
#define __GMP_REALLOCATE_FUNC_LIMBS(p, old_size, new_size)  \
  __GMP_REALLOCATE_FUNC_TYPE(p, old_size, new_size, mp_limb_t)

#define __GMP_FREE_FUNC_TYPE(p,n,type) (*__gmp_free_func) (p, (n) * sizeof (type))
#define __GMP_FREE_FUNC_LIMBS(p,n)     __GMP_FREE_FUNC_TYPE (p, n, mp_limb_t)

#define __GMP_REALLOCATE_FUNC_MAYBE(ptr, oldsize, newsize)  \
  do {         \
    if ((oldsize) != (newsize))      \
      (ptr) = (*__gmp_reallocate_func) (ptr, oldsize, newsize);  \
  } while (0)

#define __GMP_REALLOCATE_FUNC_MAYBE_TYPE(ptr, oldsize, newsize, type) \
  do {         \
    if ((oldsize) != (newsize))      \
      (ptr) = (type *) (*__gmp_reallocate_func)    \
 (ptr, (oldsize) * sizeof (type), (newsize) * sizeof (type)); \
  } while (0)


/* Dummy for non-gcc, code involving it will go dead. */
#if ! defined (__GNUC__) || __GNUC__ < 2
#define __builtin_constant_p(x)   0
#endif


/* In gcc 2.96 and up on i386, tail calls are optimized to jumps if the
   stack usage is compatible.  __attribute__ ((regparm (N))) helps by
   putting leading parameters in registers, avoiding extra stack.

   regparm cannot be used with calls going through the PLT, because the
   binding code there may clobber the registers (%eax, %edx, %ecx) used for
   the regparm parameters.  Calls to local (ie. static) functions could
   still use this, if we cared to differentiate locals and globals.

   On athlon-unknown-freebsd4.9 with gcc 3.3.3, regparm cannot be used with
   -p or -pg profiling, since that version of gcc doesn't realize the
   .mcount calls will clobber the parameter registers.  Other systems are
   ok, like debian with glibc 2.3.2 (mcount doesn't clobber), but we don't
   bother to try to detect this.  regparm is only an optimization so we just
   disable it when profiling (profiling being a slowdown anyway).  */


#if HAVE_HOST_CPU_FAMILY_x86 && __GMP_GNUC_PREREQ (2,96) && ! defined (PIC) \
  && ! WANT_PROFILING_PROF && ! WANT_PROFILING_GPROF
#define USE_LEADING_REGPARM 1
#else
#define USE_LEADING_REGPARM 0
#endif

/* Macros for altering parameter order according to regparm usage. */
#if USE_LEADING_REGPARM
#define REGPARM_2_1(a,b,x)    x,a,b
#define REGPARM_3_1(a,b,c,x)  x,a,b,c
#define REGPARM_ATTR(n) __attribute__ ((regparm (n)))
#else
#define REGPARM_2_1(a,b,x)    a,b,x
#define REGPARM_3_1(a,b,c,x)  a,b,c,x
#define REGPARM_ATTR(n)
#endif


/* ASM_L gives a local label for a gcc asm block, for use when temporary
   local labels like "1:" might not be available, which is the case for
   instance on the x86s (the SCO assembler doesn't support them).

   The label generated is made unique by including "%=" which is a unique
   number for each insn.  This ensures the same name can be used in multiple
   asm blocks, perhaps via a macro.  Since jumps between asm blocks are not
   allowed there's no need for a label to be usable outside a single
   block.  */


#define ASM_L(name)  LSYM_PREFIX "asm_%=_" #name


#if defined (__GNUC__) && HAVE_HOST_CPU_FAMILY_x86
#if 0
/* FIXME: Check that these actually improve things.
   FIXME: Need a cld after each std.
   FIXME: Can't have inputs in clobbered registers, must describe them as
   dummy outputs, and add volatile. */

#define MPN_COPY_INCR(DST, SRC, N)     \
  __asm__ ("cld\n\trep\n\tmovsl" : :     \
    "D" (DST), "S" (SRC), "c" (N) :    \
    "cx""di""si""memory")
#define MPN_COPY_DECR(DST, SRC, N)     \
  __asm__ ("std\n\trep\n\tmovsl" : :     \
    "D" ((DST) + (N) - 1), "S" ((SRC) + (N) - 1), "c" (N) : \
    "cx""di""si""memory")
#endif
#endif


__GMP_DECLSPEC void __gmpz_aorsmul_1 (REGPARM_3_1 (mpz_ptr, mpz_srcptr, mp_limb_t, mp_size_t)) REGPARM_ATTR(1);
#define mpz_aorsmul_1(w,u,v,sub)  __gmpz_aorsmul_1 (REGPARM_3_1 (w, u, v, sub))

#define mpz_n_pow_ui __gmpz_n_pow_ui
__GMP_DECLSPEC void    mpz_n_pow_ui (mpz_ptr, mp_srcptr, mp_size_t, unsigned long);


#define mpn_addmul_1c __MPN(addmul_1c)
__GMP_DECLSPEC mp_limb_t mpn_addmul_1c (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t, mp_limb_t);

#ifndef mpn_addmul_2  /* if not done with cpuvec in a fat binary */
#define mpn_addmul_2 __MPN(addmul_2)
__GMP_DECLSPEC mp_limb_t mpn_addmul_2 (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr);
#endif

#define mpn_addmul_3 __MPN(addmul_3)
__GMP_DECLSPEC mp_limb_t mpn_addmul_3 (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr);

#define mpn_addmul_4 __MPN(addmul_4)
__GMP_DECLSPEC mp_limb_t mpn_addmul_4 (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr);

#define mpn_addmul_5 __MPN(addmul_5)
__GMP_DECLSPEC mp_limb_t mpn_addmul_5 (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr);

#define mpn_addmul_6 __MPN(addmul_6)
__GMP_DECLSPEC mp_limb_t mpn_addmul_6 (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr);

#define mpn_addmul_7 __MPN(addmul_7)
__GMP_DECLSPEC mp_limb_t mpn_addmul_7 (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr);

#define mpn_addmul_8 __MPN(addmul_8)
__GMP_DECLSPEC mp_limb_t mpn_addmul_8 (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr);

/* Alternative entry point in mpn_addmul_2 for the benefit of mpn_sqr_basecase.  */
#define mpn_addmul_2s __MPN(addmul_2s)
__GMP_DECLSPEC mp_limb_t mpn_addmul_2s (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr);

/* Override mpn_addlsh1_n, mpn_addlsh2_n, mpn_sublsh1_n, etc with mpn_addlsh_n,
   etc when !HAVE_NATIVE the former but HAVE_NATIVE_ the latter.  Similarly,
   override foo_ip1 functions with foo.  We then lie and say these macros
   represent native functions, but leave a trace by using the value 2 rather
   than 1.  */


#if HAVE_NATIVE_mpn_addlsh_n && ! HAVE_NATIVE_mpn_addlsh1_n
#define mpn_addlsh1_n(a,b,c,d)          mpn_addlsh_n(a,b,c,d,1)
#define HAVE_NATIVE_mpn_addlsh1_n       2
#endif

#if HAVE_NATIVE_mpn_addlsh_nc && ! HAVE_NATIVE_mpn_addlsh1_nc
#define mpn_addlsh1_nc(a,b,c,d,x)       mpn_addlsh_nc(a,b,c,d,1,x)
#define HAVE_NATIVE_mpn_addlsh1_nc      2
#endif

#if HAVE_NATIVE_mpn_addlsh1_n && ! HAVE_NATIVE_mpn_addlsh1_n_ip1
#define mpn_addlsh1_n_ip1(a,b,n)        mpn_addlsh1_n(a,a,b,n)
#define HAVE_NATIVE_mpn_addlsh1_n_ip1   2
#endif

#if HAVE_NATIVE_mpn_addlsh1_nc && ! HAVE_NATIVE_mpn_addlsh1_nc_ip1
#define mpn_addlsh1_nc_ip1(a,b,n,c)     mpn_addlsh1_nc(a,a,b,n,c)
#define HAVE_NATIVE_mpn_addlsh1_nc_ip1  2
#endif

#if HAVE_NATIVE_mpn_addlsh_n && ! HAVE_NATIVE_mpn_addlsh2_n
#define mpn_addlsh2_n(a,b,c,d)          mpn_addlsh_n(a,b,c,d,2)
#define HAVE_NATIVE_mpn_addlsh2_n       2
#endif

#if HAVE_NATIVE_mpn_addlsh_nc && ! HAVE_NATIVE_mpn_addlsh2_nc
#define mpn_addlsh2_nc(a,b,c,d,x)       mpn_addlsh_nc(a,b,c,d,2,x)
#define HAVE_NATIVE_mpn_addlsh2_nc      2
#endif

#if HAVE_NATIVE_mpn_addlsh2_n && ! HAVE_NATIVE_mpn_addlsh2_n_ip1
#define mpn_addlsh2_n_ip1(a,b,n)        mpn_addlsh2_n(a,a,b,n)
#define HAVE_NATIVE_mpn_addlsh2_n_ip1   2
#endif

#if HAVE_NATIVE_mpn_addlsh2_nc && ! HAVE_NATIVE_mpn_addlsh2_nc_ip1
#define mpn_addlsh2_nc_ip1(a,b,n,c)     mpn_addlsh2_nc(a,a,b,n,c)
#define HAVE_NATIVE_mpn_addlsh2_nc_ip1  2
#endif

#if HAVE_NATIVE_mpn_sublsh_n && ! HAVE_NATIVE_mpn_sublsh1_n
#define mpn_sublsh1_n(a,b,c,d)          mpn_sublsh_n(a,b,c,d,1)
#define HAVE_NATIVE_mpn_sublsh1_n       2
#endif

#if HAVE_NATIVE_mpn_sublsh_nc && ! HAVE_NATIVE_mpn_sublsh1_nc
#define mpn_sublsh1_nc(a,b,c,d,x)       mpn_sublsh_nc(a,b,c,d,1,x)
#define HAVE_NATIVE_mpn_sublsh1_nc      2
#endif

#if HAVE_NATIVE_mpn_sublsh1_n && ! HAVE_NATIVE_mpn_sublsh1_n_ip1
#define mpn_sublsh1_n_ip1(a,b,n)        mpn_sublsh1_n(a,a,b,n)
#define HAVE_NATIVE_mpn_sublsh1_n_ip1   2
#endif

#if HAVE_NATIVE_mpn_sublsh1_nc && ! HAVE_NATIVE_mpn_sublsh1_nc_ip1
#define mpn_sublsh1_nc_ip1(a,b,n,c)     mpn_sublsh1_nc(a,a,b,n,c)
#define HAVE_NATIVE_mpn_sublsh1_nc_ip1  2
#endif

#if HAVE_NATIVE_mpn_sublsh_n && ! HAVE_NATIVE_mpn_sublsh2_n
#define mpn_sublsh2_n(a,b,c,d)          mpn_sublsh_n(a,b,c,d,2)
#define HAVE_NATIVE_mpn_sublsh2_n       2
#endif

#if HAVE_NATIVE_mpn_sublsh_nc && ! HAVE_NATIVE_mpn_sublsh2_nc
#define mpn_sublsh2_nc(a,b,c,d,x)       mpn_sublsh_nc(a,b,c,d,2,x)
#define HAVE_NATIVE_mpn_sublsh2_nc      2
#endif

#if HAVE_NATIVE_mpn_sublsh2_n && ! HAVE_NATIVE_mpn_sublsh2_n_ip1
#define mpn_sublsh2_n_ip1(a,b,n)        mpn_sublsh2_n(a,a,b,n)
#define HAVE_NATIVE_mpn_sublsh2_n_ip1   2
#endif

#if HAVE_NATIVE_mpn_sublsh2_nc && ! HAVE_NATIVE_mpn_sublsh2_nc_ip1
#define mpn_sublsh2_nc_ip1(a,b,n,c)     mpn_sublsh2_nc(a,a,b,n,c)
#define HAVE_NATIVE_mpn_sublsh2_nc_ip1  2
#endif

#if HAVE_NATIVE_mpn_rsblsh_n && ! HAVE_NATIVE_mpn_rsblsh1_n
#define mpn_rsblsh1_n(a,b,c,d)          mpn_rsblsh_n(a,b,c,d,1)
#define HAVE_NATIVE_mpn_rsblsh1_n       2
#endif

#if HAVE_NATIVE_mpn_rsblsh_nc && ! HAVE_NATIVE_mpn_rsblsh1_nc
#define mpn_rsblsh1_nc(a,b,c,d,x)       mpn_rsblsh_nc(a,b,c,d,1,x)
#define HAVE_NATIVE_mpn_rsblsh1_nc      2
#endif

#if HAVE_NATIVE_mpn_rsblsh1_n && ! HAVE_NATIVE_mpn_rsblsh1_n_ip1
#define mpn_rsblsh1_n_ip1(a,b,n)        mpn_rsblsh1_n(a,a,b,n)
#define HAVE_NATIVE_mpn_rsblsh1_n_ip1   2
#endif

#if HAVE_NATIVE_mpn_rsblsh1_nc && ! HAVE_NATIVE_mpn_rsblsh1_nc_ip1
#define mpn_rsblsh1_nc_ip1(a,b,n,c)     mpn_rsblsh1_nc(a,a,b,n,c)
#define HAVE_NATIVE_mpn_rsblsh1_nc_ip1  2
#endif

#if HAVE_NATIVE_mpn_rsblsh_n && ! HAVE_NATIVE_mpn_rsblsh2_n
#define mpn_rsblsh2_n(a,b,c,d)          mpn_rsblsh_n(a,b,c,d,2)
#define HAVE_NATIVE_mpn_rsblsh2_n       2
#endif

#if HAVE_NATIVE_mpn_rsblsh_nc && ! HAVE_NATIVE_mpn_rsblsh2_nc
#define mpn_rsblsh2_nc(a,b,c,d,x)       mpn_rsblsh_nc(a,b,c,d,2,x)
#define HAVE_NATIVE_mpn_rsblsh2_nc      2
#endif

#if HAVE_NATIVE_mpn_rsblsh2_n && ! HAVE_NATIVE_mpn_rsblsh2_n_ip1
#define mpn_rsblsh2_n_ip1(a,b,n)        mpn_rsblsh2_n(a,a,b,n)
#define HAVE_NATIVE_mpn_rsblsh2_n_ip1   2
#endif

#if HAVE_NATIVE_mpn_rsblsh2_nc && ! HAVE_NATIVE_mpn_rsblsh2_nc_ip1
#define mpn_rsblsh2_nc_ip1(a,b,n,c)     mpn_rsblsh2_nc(a,a,b,n,c)
#define HAVE_NATIVE_mpn_rsblsh2_nc_ip1  2
#endif


#ifndef mpn_addlsh1_n
#define mpn_addlsh1_n __MPN(addlsh1_n)
__GMP_DECLSPEC mp_limb_t mpn_addlsh1_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);
#endif
#ifndef mpn_addlsh1_nc
#define mpn_addlsh1_nc __MPN(addlsh1_nc)
__GMP_DECLSPEC mp_limb_t mpn_addlsh1_nc (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t, mp_limb_t);
#endif
#ifndef mpn_addlsh1_n_ip1
#define mpn_addlsh1_n_ip1 __MPN(addlsh1_n_ip1)
__GMP_DECLSPEC mp_limb_t mpn_addlsh1_n_ip1 (mp_ptr, mp_srcptr, mp_size_t);
#endif
#ifndef mpn_addlsh1_nc_ip1
#define mpn_addlsh1_nc_ip1 __MPN(addlsh1_nc_ip1)
__GMP_DECLSPEC mp_limb_t mpn_addlsh1_nc_ip1 (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t);
#endif

#ifndef mpn_addlsh2_n
#define mpn_addlsh2_n __MPN(addlsh2_n)
__GMP_DECLSPEC mp_limb_t mpn_addlsh2_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);
#endif
#ifndef mpn_addlsh2_nc
#define mpn_addlsh2_nc __MPN(addlsh2_nc)
__GMP_DECLSPEC mp_limb_t mpn_addlsh2_nc (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t, mp_limb_t);
#endif
#ifndef mpn_addlsh2_n_ip1
#define mpn_addlsh2_n_ip1 __MPN(addlsh2_n_ip1)
__GMP_DECLSPEC mp_limb_t mpn_addlsh2_n_ip1 (mp_ptr, mp_srcptr, mp_size_t);
#endif
#ifndef mpn_addlsh2_nc_ip1
#define mpn_addlsh2_nc_ip1 __MPN(addlsh2_nc_ip1)
__GMP_DECLSPEC mp_limb_t mpn_addlsh2_nc_ip1 (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t);
#endif

#ifndef mpn_addlsh_n
#define mpn_addlsh_n __MPN(addlsh_n)
__GMP_DECLSPEC mp_limb_t mpn_addlsh_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t, unsigned int);
#endif
#ifndef mpn_addlsh_nc
#define mpn_addlsh_nc __MPN(addlsh_nc)
__GMP_DECLSPEC mp_limb_t mpn_addlsh_nc (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t, unsigned int, mp_limb_t);
#endif
#ifndef mpn_addlsh_n_ip1
#define mpn_addlsh_n_ip1 __MPN(addlsh_n_ip1)
  __GMP_DECLSPEC mp_limb_t mpn_addlsh_n_ip1 (mp_ptr, mp_srcptr, mp_size_t, unsigned int);
#endif
#ifndef mpn_addlsh_nc_ip1
#define mpn_addlsh_nc_ip1 __MPN(addlsh_nc_ip1)
__GMP_DECLSPEC mp_limb_t mpn_addlsh_nc_ip1 (mp_ptr, mp_srcptr, mp_size_t, unsigned intmp_limb_t);
#endif

#ifndef mpn_sublsh1_n
#define mpn_sublsh1_n __MPN(sublsh1_n)
__GMP_DECLSPEC mp_limb_t mpn_sublsh1_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);
#endif
#ifndef mpn_sublsh1_nc
#define mpn_sublsh1_nc __MPN(sublsh1_nc)
__GMP_DECLSPEC mp_limb_t mpn_sublsh1_nc (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t, mp_limb_t);
#endif
#ifndef mpn_sublsh1_n_ip1
#define mpn_sublsh1_n_ip1 __MPN(sublsh1_n_ip1)
__GMP_DECLSPEC mp_limb_t mpn_sublsh1_n_ip1 (mp_ptr, mp_srcptr, mp_size_t);
#endif
#ifndef mpn_sublsh1_nc_ip1
#define mpn_sublsh1_nc_ip1 __MPN(sublsh1_nc_ip1)
__GMP_DECLSPEC mp_limb_t mpn_sublsh1_nc_ip1 (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t);
#endif

#ifndef mpn_sublsh2_n
#define mpn_sublsh2_n __MPN(sublsh2_n)
__GMP_DECLSPEC mp_limb_t mpn_sublsh2_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);
#endif
#ifndef mpn_sublsh2_nc
#define mpn_sublsh2_nc __MPN(sublsh2_nc)
__GMP_DECLSPEC mp_limb_t mpn_sublsh2_nc (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t, mp_limb_t);
#endif
#ifndef mpn_sublsh2_n_ip1
#define mpn_sublsh2_n_ip1 __MPN(sublsh2_n_ip1)
__GMP_DECLSPEC mp_limb_t mpn_sublsh2_n_ip1 (mp_ptr, mp_srcptr, mp_size_t);
#endif
#ifndef mpn_sublsh2_nc_ip1
#define mpn_sublsh2_nc_ip1 __MPN(sublsh2_nc_ip1)
__GMP_DECLSPEC mp_limb_t mpn_sublsh2_nc_ip1 (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t);
#endif

#ifndef mpn_sublsh_n
#define mpn_sublsh_n __MPN(sublsh_n)
__GMP_DECLSPEC mp_limb_t mpn_sublsh_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t, unsigned int);
#endif
#ifndef mpn_sublsh_nc
#define mpn_sublsh_nc __MPN(sublsh_nc)
__GMP_DECLSPEC mp_limb_t mpn_sublsh_nc (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t, unsigned int, mp_limb_t);
#endif
#ifndef mpn_sublsh_n_ip1
#define mpn_sublsh_n_ip1 __MPN(sublsh_n_ip1)
  __GMP_DECLSPEC mp_limb_t mpn_sublsh_n_ip1 (mp_ptr, mp_srcptr, mp_size_t, unsigned int);
#endif
#ifndef mpn_sublsh_nc_ip1
#define mpn_sublsh_nc_ip1 __MPN(sublsh_nc_ip1)
__GMP_DECLSPEC mp_limb_t mpn_sublsh_nc_ip1 (mp_ptr, mp_srcptr, mp_size_t, unsigned intmp_limb_t);
#endif

#define mpn_rsblsh1_n __MPN(rsblsh1_n)
__GMP_DECLSPEC mp_limb_signed_t mpn_rsblsh1_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);
#define mpn_rsblsh1_nc __MPN(rsblsh1_nc)
__GMP_DECLSPEC mp_limb_signed_t mpn_rsblsh1_nc (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t, mp_limb_t);

#define mpn_rsblsh2_n __MPN(rsblsh2_n)
__GMP_DECLSPEC mp_limb_signed_t mpn_rsblsh2_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);
#define mpn_rsblsh2_nc __MPN(rsblsh2_nc)
__GMP_DECLSPEC mp_limb_signed_t mpn_rsblsh2_nc (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t, mp_limb_t);

#define mpn_rsblsh_n __MPN(rsblsh_n)
__GMP_DECLSPEC mp_limb_signed_t mpn_rsblsh_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t, unsigned int);
#define mpn_rsblsh_nc __MPN(rsblsh_nc)
__GMP_DECLSPEC mp_limb_signed_t mpn_rsblsh_nc (mp_ptr, mp_srcptr, mp_srcptr, mp_size_tunsigned int, mp_limb_t);

#define mpn_rsh1add_n __MPN(rsh1add_n)
__GMP_DECLSPEC mp_limb_t mpn_rsh1add_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);
#define mpn_rsh1add_nc __MPN(rsh1add_nc)
__GMP_DECLSPEC mp_limb_t mpn_rsh1add_nc (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t, mp_limb_t);

#define mpn_rsh1sub_n __MPN(rsh1sub_n)
__GMP_DECLSPEC mp_limb_t mpn_rsh1sub_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);
#define mpn_rsh1sub_nc __MPN(rsh1sub_nc)
__GMP_DECLSPEC mp_limb_t mpn_rsh1sub_nc (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t, mp_limb_t);

#ifndef mpn_lshiftc  /* if not done with cpuvec in a fat binary */
#define mpn_lshiftc __MPN(lshiftc)
__GMP_DECLSPEC mp_limb_t mpn_lshiftc (mp_ptr, mp_srcptr, mp_size_t, unsigned int);
#endif

#define mpn_add_err1_n  __MPN(add_err1_n)
__GMP_DECLSPEC mp_limb_t mpn_add_err1_n (mp_ptr, mp_srcptr, mp_srcptr, mp_ptr, mp_srcptr, mp_size_t, mp_limb_t);

#define mpn_add_err2_n  __MPN(add_err2_n)
__GMP_DECLSPEC mp_limb_t mpn_add_err2_n (mp_ptr, mp_srcptr, mp_srcptr, mp_ptr, mp_srcptr, mp_srcptr, mp_size_t, mp_limb_t);

#define mpn_add_err3_n  __MPN(add_err3_n)
__GMP_DECLSPEC mp_limb_t mpn_add_err3_n (mp_ptr, mp_srcptr, mp_srcptr, mp_ptr, mp_srcptr, mp_srcptr, mp_srcptr, mp_size_t, mp_limb_t);

#define mpn_sub_err1_n  __MPN(sub_err1_n)
__GMP_DECLSPEC mp_limb_t mpn_sub_err1_n (mp_ptr, mp_srcptr, mp_srcptr, mp_ptr, mp_srcptr, mp_size_t, mp_limb_t);

#define mpn_sub_err2_n  __MPN(sub_err2_n)
__GMP_DECLSPEC mp_limb_t mpn_sub_err2_n (mp_ptr, mp_srcptr, mp_srcptr, mp_ptr, mp_srcptr, mp_srcptr, mp_size_t, mp_limb_t);

#define mpn_sub_err3_n  __MPN(sub_err3_n)
__GMP_DECLSPEC mp_limb_t mpn_sub_err3_n (mp_ptr, mp_srcptr, mp_srcptr, mp_ptr, mp_srcptr, mp_srcptr, mp_srcptr, mp_size_t, mp_limb_t);

#define mpn_add_n_sub_n __MPN(add_n_sub_n)
__GMP_DECLSPEC mp_limb_t mpn_add_n_sub_n (mp_ptr, mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);

#define mpn_add_n_sub_nc __MPN(add_n_sub_nc)
__GMP_DECLSPEC mp_limb_t mpn_add_n_sub_nc (mp_ptr, mp_ptr, mp_srcptr, mp_srcptr, mp_size_t, mp_limb_t);

#define mpn_addaddmul_1msb0 __MPN(addaddmul_1msb0)
__GMP_DECLSPEC mp_limb_t mpn_addaddmul_1msb0 (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t, mp_limb_t, mp_limb_t);

#define mpn_divrem_1c __MPN(divrem_1c)
__GMP_DECLSPEC mp_limb_t mpn_divrem_1c (mp_ptr, mp_size_t, mp_srcptr, mp_size_t, mp_limb_t, mp_limb_t);

#define mpn_dump __MPN(dump)
__GMP_DECLSPEC void mpn_dump (mp_srcptr, mp_size_t);

#define mpn_fib2_ui __MPN(fib2_ui)
__GMP_DECLSPEC mp_size_t mpn_fib2_ui (mp_ptr, mp_ptr, unsigned long);

#define mpn_fib2m __MPN(fib2m)
__GMP_DECLSPEC int mpn_fib2m (mp_ptr, mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t);

#define mpn_strongfibo __MPN(strongfibo)
__GMP_DECLSPEC int mpn_strongfibo (mp_srcptr, mp_size_t, mp_ptr);

/* Remap names of internal mpn functions.  */
#define __clz_tab               __MPN(clz_tab)
#define mpn_udiv_w_sdiv  __MPN(udiv_w_sdiv)

#define mpn_jacobi_base __MPN(jacobi_base)
__GMP_DECLSPEC int mpn_jacobi_base (mp_limb_t, mp_limb_t, int) ATTRIBUTE_CONST;

#define mpn_jacobi_2 __MPN(jacobi_2)
__GMP_DECLSPEC int mpn_jacobi_2 (mp_srcptr, mp_srcptr, unsigned);

#define mpn_jacobi_n __MPN(jacobi_n)
__GMP_DECLSPEC int mpn_jacobi_n (mp_ptr, mp_ptr, mp_size_t, unsigned);

#define mpn_mod_1c __MPN(mod_1c)
__GMP_DECLSPEC mp_limb_t mpn_mod_1c (mp_srcptr, mp_size_t, mp_limb_t, mp_limb_t) __GMP_ATTRIBUTE_PURE;

#define mpn_mul_1c __MPN(mul_1c)
__GMP_DECLSPEC mp_limb_t mpn_mul_1c (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t, mp_limb_t);

#define mpn_mul_2 __MPN(mul_2)
__GMP_DECLSPEC mp_limb_t mpn_mul_2 (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr);

#define mpn_mul_3 __MPN(mul_3)
__GMP_DECLSPEC mp_limb_t mpn_mul_3 (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr);

#define mpn_mul_4 __MPN(mul_4)
__GMP_DECLSPEC mp_limb_t mpn_mul_4 (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr);

#define mpn_mul_5 __MPN(mul_5)
__GMP_DECLSPEC mp_limb_t mpn_mul_5 (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr);

#define mpn_mul_6 __MPN(mul_6)
__GMP_DECLSPEC mp_limb_t mpn_mul_6 (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr);

#ifndef mpn_mul_basecase  /* if not done with cpuvec in a fat binary */
#define mpn_mul_basecase __MPN(mul_basecase)
__GMP_DECLSPEC void mpn_mul_basecase (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t);
#endif

#define mpn_mullo_n __MPN(mullo_n)
__GMP_DECLSPEC void mpn_mullo_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);

#ifndef mpn_mullo_basecase  /* if not done with cpuvec in a fat binary */
#define mpn_mullo_basecase __MPN(mullo_basecase)
__GMP_DECLSPEC void mpn_mullo_basecase (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);
#endif

#ifndef mpn_sqr_basecase  /* if not done with cpuvec in a fat binary */
#define mpn_sqr_basecase __MPN(sqr_basecase)
__GMP_DECLSPEC void mpn_sqr_basecase (mp_ptr, mp_srcptr, mp_size_t);
#endif

#define mpn_sqrlo __MPN(sqrlo)
__GMP_DECLSPEC void mpn_sqrlo (mp_ptr, mp_srcptr, mp_size_t);

#define mpn_sqrlo_basecase __MPN(sqrlo_basecase)
__GMP_DECLSPEC void mpn_sqrlo_basecase (mp_ptr, mp_srcptr, mp_size_t);

#define mpn_mulmid_basecase __MPN(mulmid_basecase)
__GMP_DECLSPEC void mpn_mulmid_basecase (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t);

#define mpn_mulmid_n __MPN(mulmid_n)
__GMP_DECLSPEC void mpn_mulmid_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);

#define mpn_mulmid __MPN(mulmid)
__GMP_DECLSPEC void mpn_mulmid (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t);

#define mpn_submul_1c __MPN(submul_1c)
__GMP_DECLSPEC mp_limb_t mpn_submul_1c (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t, mp_limb_t);

#ifndef mpn_redc_1  /* if not done with cpuvec in a fat binary */
#define mpn_redc_1 __MPN(redc_1)
__GMP_DECLSPEC mp_limb_t mpn_redc_1 (mp_ptr, mp_ptr, mp_srcptr, mp_size_t, mp_limb_t);
#endif

#ifndef mpn_redc_2  /* if not done with cpuvec in a fat binary */
#define mpn_redc_2 __MPN(redc_2)
__GMP_DECLSPEC mp_limb_t mpn_redc_2 (mp_ptr, mp_ptr, mp_srcptr, mp_size_t, mp_srcptr);
#endif

#define mpn_redc_n __MPN(redc_n)
__GMP_DECLSPEC void mpn_redc_n (mp_ptr, mp_ptr, mp_srcptr, mp_size_t, mp_srcptr);


#ifndef mpn_mod_1_1p_cps  /* if not done with cpuvec in a fat binary */
#define mpn_mod_1_1p_cps __MPN(mod_1_1p_cps)
__GMP_DECLSPEC void mpn_mod_1_1p_cps (mp_limb_t [4], mp_limb_t);
#endif
#ifndef mpn_mod_1_1p  /* if not done with cpuvec in a fat binary */
#define mpn_mod_1_1p __MPN(mod_1_1p)
__GMP_DECLSPEC mp_limb_t mpn_mod_1_1p (mp_srcptr, mp_size_t, mp_limb_t, const mp_limb_t [4]) __GMP_ATTRIBUTE_PURE;
#endif

#ifndef mpn_mod_1s_2p_cps  /* if not done with cpuvec in a fat binary */
#define mpn_mod_1s_2p_cps __MPN(mod_1s_2p_cps)
__GMP_DECLSPEC void mpn_mod_1s_2p_cps (mp_limb_t [5], mp_limb_t);
#endif
#ifndef mpn_mod_1s_2p  /* if not done with cpuvec in a fat binary */
#define mpn_mod_1s_2p __MPN(mod_1s_2p)
__GMP_DECLSPEC mp_limb_t mpn_mod_1s_2p (mp_srcptr, mp_size_t, mp_limb_t, const mp_limb_t [5]) __GMP_ATTRIBUTE_PURE;
#endif

#ifndef mpn_mod_1s_3p_cps  /* if not done with cpuvec in a fat binary */
#define mpn_mod_1s_3p_cps __MPN(mod_1s_3p_cps)
__GMP_DECLSPEC void mpn_mod_1s_3p_cps (mp_limb_t [6], mp_limb_t);
#endif
#ifndef mpn_mod_1s_3p  /* if not done with cpuvec in a fat binary */
#define mpn_mod_1s_3p __MPN(mod_1s_3p)
__GMP_DECLSPEC mp_limb_t mpn_mod_1s_3p (mp_srcptr, mp_size_t, mp_limb_t, const mp_limb_t [6]) __GMP_ATTRIBUTE_PURE;
#endif

#ifndef mpn_mod_1s_4p_cps  /* if not done with cpuvec in a fat binary */
#define mpn_mod_1s_4p_cps __MPN(mod_1s_4p_cps)
__GMP_DECLSPEC void mpn_mod_1s_4p_cps (mp_limb_t [7], mp_limb_t);
#endif
#ifndef mpn_mod_1s_4p  /* if not done with cpuvec in a fat binary */
#define mpn_mod_1s_4p __MPN(mod_1s_4p)
__GMP_DECLSPEC mp_limb_t mpn_mod_1s_4p (mp_srcptr, mp_size_t, mp_limb_t, const mp_limb_t [7]) __GMP_ATTRIBUTE_PURE;
#endif

#define mpn_bc_mulmod_bnm1 __MPN(bc_mulmod_bnm1)
__GMP_DECLSPEC void mpn_bc_mulmod_bnm1 (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t, mp_ptr);
#define mpn_mulmod_bnm1 __MPN(mulmod_bnm1)
__GMP_DECLSPEC void mpn_mulmod_bnm1 (mp_ptr, mp_size_t, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t, mp_ptr);
#define mpn_mulmod_bnm1_next_size __MPN(mulmod_bnm1_next_size)
__GMP_DECLSPEC mp_size_t mpn_mulmod_bnm1_next_size (mp_size_t) ATTRIBUTE_CONST;
static inline mp_size_t
mpn_mulmod_bnm1_itch (mp_size_t rn, mp_size_t an, mp_size_t bn) {
  mp_size_t n, itch;
  n = rn >> 1;
  itch = rn + 4 +
    (an > n ? (bn > n ? rn : n) : 0);
  return itch;
}

#ifndef MOD_BKNP1_USE11
#define MOD_BKNP1_USE11 ((GMP_NUMB_BITS % 8 != 0) && (GMP_NUMB_BITS % 2 == 0))
#endif
#ifndef MOD_BKNP1_ONLY3
#define MOD_BKNP1_ONLY3 0
#endif
#define mpn_mulmod_bknp1 __MPN(mulmod_bknp1)
__GMP_DECLSPEC void mpn_mulmod_bknp1 (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t, unsigned, mp_ptr);
static inline mp_size_t
mpn_mulmod_bknp1_itch (mp_size_t rn) {
  return rn << 2;
}
#if MOD_BKNP1_ONLY3
#define MPN_MULMOD_BKNP1_USABLE(rn, k, mn)    \
  ((GMP_NUMB_BITS % 8 == 0) && ((mn) >= 18) && ((rn) > 16) &&  \
   (((rn) % ((k) = 3) == 0)))
#else
#define MPN_MULMOD_BKNP1_USABLE(rn, k, mn)    \
  (((GMP_NUMB_BITS % 8 == 0) && ((mn) >= 18) && ((rn) > 16) &&  \
    (((rn) % ((k) = 3) == 0) ||      \
     (((GMP_NUMB_BITS % 16 != 0) || (((mn) >= 35) && ((rn) >= 32))) && \
      (((GMP_NUMB_BITS % 16 == 0) && ((rn) % ((k) = 5) == 0)) || \
       (((mn) >= 49) &&       \
 (((rn) % ((k) = 7) == 0) ||     \
  ((GMP_NUMB_BITS % 16 == 0) && ((mn) >= 104) && ((rn) >= 64) && \
   ((MOD_BKNP1_USE11 && ((rn) % ((k) = 11) == 0)) ||  \
    ((rn) % ((k) = 13) == 0) ||     \
    ((GMP_NUMB_BITS % 32 == 0) && ((mn) >= 136) && ((rn) >= 128) && \
     ((rn) % ((k) = 17) == 0)     \
     ))))))))) ||      \
  ((GMP_NUMB_BITS % 16 != 0) && MOD_BKNP1_USE11 &&   \
   ((mn) >= 104) && ((rn) >= 64) && ((rn) % ((k) = 11) == 0)) )
#endif

#define mpn_sqrmod_bknp1 __MPN(sqrmod_bknp1)
__GMP_DECLSPEC void mpn_sqrmod_bknp1 (mp_ptr, mp_srcptr, mp_size_t, unsigned, mp_ptr);
static inline mp_size_t
mpn_sqrmod_bknp1_itch (mp_size_t rn) {
  return rn * 3;
}
#if MOD_BKNP1_ONLY3
#define MPN_SQRMOD_BKNP1_USABLE(rn, k, mn)    \
  MPN_MULMOD_BKNP1_USABLE(rn, k, mn)
#else
#define MPN_SQRMOD_BKNP1_USABLE(rn, k, mn)    \
  (((GMP_NUMB_BITS % 8 == 0) && ((mn) >= 27) && ((rn) > 24) &&  \
    (((rn) % ((k) = 3) == 0) ||      \
     (((GMP_NUMB_BITS % 16 != 0) || (((mn) >= 55) && ((rn) > 50))) && \
      (((GMP_NUMB_BITS % 16 == 0) && ((rn) % ((k) = 5) == 0)) || \
       (((mn) >= 56) &&       \
 (((rn) % ((k) = 7) == 0) ||     \
  ((GMP_NUMB_BITS % 16 == 0) && ((mn) >= 143) && ((rn) >= 128) && \
   ((MOD_BKNP1_USE11 && ((rn) % ((k) = 11) == 0)) ||  \
    ((rn) % ((k) = 13) == 0) ||     \
    ((GMP_NUMB_BITS % 32 == 0) && ((mn) >= 272) && ((rn) >= 256) && \
     ((rn) % ((k) = 17) == 0)     \
     ))))))))) ||      \
   ((GMP_NUMB_BITS % 16 != 0) && MOD_BKNP1_USE11 &&   \
    ((mn) >= 143) && ((rn) >= 128) && ((rn) % ((k) = 11) == 0)) )
#endif


#define mpn_sqrmod_bnm1 __MPN(sqrmod_bnm1)
__GMP_DECLSPEC void mpn_sqrmod_bnm1 (mp_ptr, mp_size_t, mp_srcptr, mp_size_t, mp_ptr);
#define mpn_sqrmod_bnm1_next_size __MPN(sqrmod_bnm1_next_size)
__GMP_DECLSPEC mp_size_t mpn_sqrmod_bnm1_next_size (mp_size_t) ATTRIBUTE_CONST;
static inline mp_size_t
mpn_sqrmod_bnm1_itch (mp_size_t rn, mp_size_t an) {
  mp_size_t n, itch;
  n = rn >> 1;
  itch = rn + 3 +
    (an > n ? an : 0);
  return itch;
}

/* Pseudo-random number generator function pointers structure.  */
typedef struct {
  void (*randseed_fn) (gmp_randstate_ptr, mpz_srcptr);
  void (*randget_fn) (gmp_randstate_ptr, mp_ptr, unsigned long int);
  void (*randclear_fn) (gmp_randstate_ptr);
  void (*randiset_fn) (gmp_randstate_ptr, gmp_randstate_srcptr);
} gmp_randfnptr_t;

/* Macro to obtain a void pointer to the function pointers structure.  */
#define RNG_FNPTR(rstate) ((rstate)->_mp_algdata._mp_lc)

/* Macro to obtain a pointer to the generator's state.
   When used as a lvalue the rvalue needs to be cast to mp_ptr.  */

#define RNG_STATE(rstate) ((rstate)->_mp_seed->_mp_d)

/* Write a given number of random bits to rp.  */
#define _gmp_rand(rp, state, bits)     \
  do {         \
    gmp_randstate_ptr  __rstate = (state);    \
    (*((gmp_randfnptr_t *) RNG_FNPTR (__rstate))->randget_fn)  \
      (__rstate, rp, bits);      \
  } while (0)

__GMP_DECLSPEC void __gmp_randinit_mt_noseed (gmp_randstate_ptr);


/* __gmp_rands is the global state for the old-style random functions, and
   is also used in the test programs (hence the __GMP_DECLSPEC).

   There's no seeding here, so mpz_random etc will generate the same
   sequence every time.  This is not unlike the C library random functions
   if you don't seed them, so perhaps it's acceptable.  Digging up a seed
   from /dev/random or the like would work on many systems, but might
   encourage a false confidence, since it'd be pretty much impossible to do
   something that would work reliably everywhere.  In any case the new style
   functions are recommended to applications which care about randomness, so
   the old functions aren't too important.  */


__GMP_DECLSPEC extern char             __gmp_rands_initialized;
__GMP_DECLSPEC extern gmp_randstate_t  __gmp_rands;

#define RANDS        \
  ((__gmp_rands_initialized ? 0      \
    : (__gmp_rands_initialized = 1,     \
       __gmp_randinit_mt_noseed (__gmp_rands), 0)),   \
   __gmp_rands)

/* this is used by the test programs, to free memory */
#define RANDS_CLEAR()       \
  do {         \
    if (__gmp_rands_initialized)     \
      {         \
 __gmp_rands_initialized = 0;     \
 gmp_randclear (__gmp_rands);     \
      }         \
  } while (0)


/* For a threshold between algorithms A and B, size>=thresh is where B
   should be used.  Special value MP_SIZE_T_MAX means only ever use A, or
   value 0 means only ever use B.  The tests for these special values will
   be compile-time constants, so the compiler should be able to eliminate
   the code for the unwanted algorithm.  */


#if ! defined (__GNUC__) || __GNUC__ < 2
#define ABOVE_THRESHOLD(size,thresh)     \
  ((thresh) == 0       \
   || ((thresh) != MP_SIZE_T_MAX     \
       && (size) >= (thresh)))
#else
#define ABOVE_THRESHOLD(size,thresh)     \
  ((__builtin_constant_p (thresh) && (thresh) == 0)   \
   || (!(__builtin_constant_p (thresh) && (thresh) == MP_SIZE_T_MAX) \
       && (size) >= (thresh)))
#endif
#define BELOW_THRESHOLD(size,thresh)  (! ABOVE_THRESHOLD (size, thresh))

/* The minimal supported value for Toom22 depends also on Toom32 and
   Toom42 implementations. */

#define MPN_TOOM22_MUL_MINSIZE    6
#define MPN_TOOM2_SQR_MINSIZE     4

#define MPN_TOOM33_MUL_MINSIZE   17
#define MPN_TOOM3_SQR_MINSIZE    17

#define MPN_TOOM44_MUL_MINSIZE   30
#define MPN_TOOM4_SQR_MINSIZE    30

#define MPN_TOOM6H_MUL_MINSIZE   46
#define MPN_TOOM6_SQR_MINSIZE    46

#define MPN_TOOM8H_MUL_MINSIZE   86
#define MPN_TOOM8_SQR_MINSIZE    86

#define MPN_TOOM32_MUL_MINSIZE   10
#define MPN_TOOM42_MUL_MINSIZE   10
#define MPN_TOOM43_MUL_MINSIZE   25
#define MPN_TOOM53_MUL_MINSIZE   17
#define MPN_TOOM54_MUL_MINSIZE   31
#define MPN_TOOM63_MUL_MINSIZE   49

#define MPN_TOOM42_MULMID_MINSIZE    4

#define   mpn_sqr_diagonal __MPN(sqr_diagonal)
__GMP_DECLSPEC void      mpn_sqr_diagonal (mp_ptr, mp_srcptr, mp_size_t);

#define mpn_sqr_diag_addlsh1 __MPN(sqr_diag_addlsh1)
__GMP_DECLSPEC void      mpn_sqr_diag_addlsh1 (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);

#define   mpn_toom_interpolate_5pts __MPN(toom_interpolate_5pts)
__GMP_DECLSPEC void      mpn_toom_interpolate_5pts (mp_ptr, mp_ptr, mp_ptr, mp_size_t, mp_size_t, int, mp_limb_t);

enum toom6_flags {toom6_all_pos = 0, toom6_vm1_neg = 1, toom6_vm2_neg = 2};
#define   mpn_toom_interpolate_6pts __MPN(toom_interpolate_6pts)
__GMP_DECLSPEC void      mpn_toom_interpolate_6pts (mp_ptr, mp_size_t, enum toom6_flags, mp_ptr, mp_ptr, mp_ptr, mp_size_t);

enum toom7_flags { toom7_w1_neg = 1, toom7_w3_neg = 2 };
#define   mpn_toom_interpolate_7pts __MPN(toom_interpolate_7pts)
__GMP_DECLSPEC void      mpn_toom_interpolate_7pts (mp_ptr, mp_size_t, enum toom7_flags, mp_ptr, mp_ptr, mp_ptr, mp_ptr, mp_size_t, mp_ptr);

#define mpn_toom_interpolate_8pts __MPN(toom_interpolate_8pts)
__GMP_DECLSPEC void      mpn_toom_interpolate_8pts (mp_ptr, mp_size_t, mp_ptr, mp_ptr, mp_size_t, mp_ptr);

#define mpn_toom_interpolate_12pts __MPN(toom_interpolate_12pts)
__GMP_DECLSPEC void      mpn_toom_interpolate_12pts (mp_ptr, mp_ptr, mp_ptr, mp_ptr, mp_size_t, mp_size_t, int, mp_ptr);

#define mpn_toom_interpolate_16pts __MPN(toom_interpolate_16pts)
__GMP_DECLSPEC void      mpn_toom_interpolate_16pts (mp_ptr, mp_ptr, mp_ptr, mp_ptr, mp_ptr, mp_size_t, mp_size_t, int, mp_ptr);

#define   mpn_toom_couple_handling __MPN(toom_couple_handling)
__GMP_DECLSPEC void mpn_toom_couple_handling (mp_ptr, mp_size_t, mp_ptr, int, mp_size_tintint);

#define   mpn_toom_eval_dgr3_pm1 __MPN(toom_eval_dgr3_pm1)
__GMP_DECLSPEC int mpn_toom_eval_dgr3_pm1 (mp_ptr, mp_ptr, mp_srcptr, mp_size_t, mp_size_t, mp_ptr);

#define   mpn_toom_eval_dgr3_pm2 __MPN(toom_eval_dgr3_pm2)
__GMP_DECLSPEC int mpn_toom_eval_dgr3_pm2 (mp_ptr, mp_ptr, mp_srcptr, mp_size_t, mp_size_t, mp_ptr);

#define   mpn_toom_eval_pm1 __MPN(toom_eval_pm1)
__GMP_DECLSPEC int mpn_toom_eval_pm1 (mp_ptr, mp_ptr, unsigned, mp_srcptr, mp_size_t, mp_size_t, mp_ptr);

#define   mpn_toom_eval_pm2 __MPN(toom_eval_pm2)
__GMP_DECLSPEC int mpn_toom_eval_pm2 (mp_ptr, mp_ptr, unsigned, mp_srcptr, mp_size_t, mp_size_t, mp_ptr);

#define   mpn_toom_eval_pm2exp __MPN(toom_eval_pm2exp)
__GMP_DECLSPEC int mpn_toom_eval_pm2exp (mp_ptr, mp_ptr, unsigned, mp_srcptr, mp_size_t, mp_size_t, unsigned, mp_ptr);

#define   mpn_toom_eval_pm2rexp __MPN(toom_eval_pm2rexp)
__GMP_DECLSPEC int mpn_toom_eval_pm2rexp (mp_ptr, mp_ptr, unsigned, mp_srcptr, mp_size_t, mp_size_t, unsigned, mp_ptr);

#define   mpn_toom22_mul __MPN(toom22_mul)
__GMP_DECLSPEC void      mpn_toom22_mul (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t, mp_ptr);

#define   mpn_toom32_mul __MPN(toom32_mul)
__GMP_DECLSPEC void      mpn_toom32_mul (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t, mp_ptr);

#define   mpn_toom42_mul __MPN(toom42_mul)
__GMP_DECLSPEC void      mpn_toom42_mul (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t, mp_ptr);

#define   mpn_toom52_mul __MPN(toom52_mul)
__GMP_DECLSPEC void      mpn_toom52_mul (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t, mp_ptr);

#define   mpn_toom62_mul __MPN(toom62_mul)
__GMP_DECLSPEC void      mpn_toom62_mul (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t, mp_ptr);

#define   mpn_toom2_sqr __MPN(toom2_sqr)
__GMP_DECLSPEC void      mpn_toom2_sqr (mp_ptr, mp_srcptr, mp_size_t, mp_ptr);

#define   mpn_toom33_mul __MPN(toom33_mul)
__GMP_DECLSPEC void      mpn_toom33_mul (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t, mp_ptr);

#define   mpn_toom43_mul __MPN(toom43_mul)
__GMP_DECLSPEC void      mpn_toom43_mul (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t, mp_ptr);

#define   mpn_toom53_mul __MPN(toom53_mul)
__GMP_DECLSPEC void      mpn_toom53_mul (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t, mp_ptr);

#define   mpn_toom54_mul __MPN(toom54_mul)
__GMP_DECLSPEC void      mpn_toom54_mul (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t, mp_ptr);

#define   mpn_toom63_mul __MPN(toom63_mul)
__GMP_DECLSPEC void      mpn_toom63_mul (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t, mp_ptr);

#define   mpn_toom3_sqr __MPN(toom3_sqr)
__GMP_DECLSPEC void      mpn_toom3_sqr (mp_ptr, mp_srcptr, mp_size_t, mp_ptr);

#define   mpn_toom44_mul __MPN(toom44_mul)
__GMP_DECLSPEC void      mpn_toom44_mul (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t, mp_ptr);

#define   mpn_toom4_sqr __MPN(toom4_sqr)
__GMP_DECLSPEC void      mpn_toom4_sqr (mp_ptr, mp_srcptr, mp_size_t, mp_ptr);

#define   mpn_toom6h_mul __MPN(toom6h_mul)
__GMP_DECLSPEC void      mpn_toom6h_mul (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t, mp_ptr);

#define   mpn_toom6_sqr __MPN(toom6_sqr)
__GMP_DECLSPEC void      mpn_toom6_sqr (mp_ptr, mp_srcptr, mp_size_t, mp_ptr);

#define   mpn_toom8h_mul __MPN(toom8h_mul)
__GMP_DECLSPEC void      mpn_toom8h_mul (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t, mp_ptr);

#define   mpn_toom8_sqr __MPN(toom8_sqr)
__GMP_DECLSPEC void      mpn_toom8_sqr (mp_ptr, mp_srcptr, mp_size_t, mp_ptr);

#define   mpn_toom42_mulmid __MPN(toom42_mulmid)
__GMP_DECLSPEC void      mpn_toom42_mulmid (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t, mp_ptr);

#define   mpn_fft_best_k __MPN(fft_best_k)
__GMP_DECLSPEC int       mpn_fft_best_k (mp_size_t, int) ATTRIBUTE_CONST;

#define   mpn_mul_fft __MPN(mul_fft)
__GMP_DECLSPEC mp_limb_t mpn_mul_fft (mp_ptr, mp_size_t, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t, int);

#define   mpn_mul_fft_full __MPN(mul_fft_full)
__GMP_DECLSPEC void      mpn_mul_fft_full (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t);

#define   mpn_nussbaumer_mul __MPN(nussbaumer_mul)
__GMP_DECLSPEC void      mpn_nussbaumer_mul (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t);

#define   mpn_fft_next_size __MPN(fft_next_size)
__GMP_DECLSPEC mp_size_t mpn_fft_next_size (mp_size_t, int) ATTRIBUTE_CONST;

#define   mpn_div_qr_1n_pi1 __MPN(div_qr_1n_pi1)
  __GMP_DECLSPEC mp_limb_t mpn_div_qr_1n_pi1 (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t, mp_limb_t, mp_limb_t);

#define   mpn_div_qr_2n_pi1 __MPN(div_qr_2n_pi1)
  __GMP_DECLSPEC mp_limb_t mpn_div_qr_2n_pi1 (mp_ptr, mp_ptr, mp_srcptr, mp_size_t, mp_limb_t, mp_limb_t, mp_limb_t);

#define   mpn_div_qr_2u_pi1 __MPN(div_qr_2u_pi1)
  __GMP_DECLSPEC mp_limb_t mpn_div_qr_2u_pi1 (mp_ptr, mp_ptr, mp_srcptr, mp_size_t, mp_limb_t, mp_limb_t, int, mp_limb_t);

#define   mpn_sbpi1_div_qr __MPN(sbpi1_div_qr)
__GMP_DECLSPEC mp_limb_t mpn_sbpi1_div_qr (mp_ptr, mp_ptr, mp_size_t, mp_srcptr, mp_size_t, mp_limb_t);

#define   mpn_sbpi1_div_q __MPN(sbpi1_div_q)
__GMP_DECLSPEC mp_limb_t mpn_sbpi1_div_q (mp_ptr, mp_ptr, mp_size_t, mp_srcptr, mp_size_t, mp_limb_t);

#define   mpn_sbpi1_divappr_q __MPN(sbpi1_divappr_q)
__GMP_DECLSPEC mp_limb_t mpn_sbpi1_divappr_q (mp_ptr, mp_ptr, mp_size_t, mp_srcptr, mp_size_t, mp_limb_t);

#define   mpn_dcpi1_div_qr __MPN(dcpi1_div_qr)
__GMP_DECLSPEC mp_limb_t mpn_dcpi1_div_qr (mp_ptr, mp_ptr, mp_size_t, mp_srcptr, mp_size_t, gmp_pi1_t *);
#define   mpn_dcpi1_div_qr_n __MPN(dcpi1_div_qr_n)
__GMP_DECLSPEC mp_limb_t mpn_dcpi1_div_qr_n (mp_ptr, mp_ptr, mp_srcptr, mp_size_t, gmp_pi1_t *, mp_ptr);

#define   mpn_dcpi1_div_q __MPN(dcpi1_div_q)
__GMP_DECLSPEC mp_limb_t mpn_dcpi1_div_q (mp_ptr, mp_ptr, mp_size_t, mp_srcptr, mp_size_t, gmp_pi1_t *);

#define   mpn_dcpi1_divappr_q __MPN(dcpi1_divappr_q)
__GMP_DECLSPEC mp_limb_t mpn_dcpi1_divappr_q (mp_ptr, mp_ptr, mp_size_t, mp_srcptr, mp_size_t, gmp_pi1_t *);

#define   mpn_mu_div_qr __MPN(mu_div_qr)
__GMP_DECLSPEC mp_limb_t mpn_mu_div_qr (mp_ptr, mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t, mp_ptr);
#define   mpn_mu_div_qr_itch __MPN(mu_div_qr_itch)
__GMP_DECLSPEC mp_size_t mpn_mu_div_qr_itch (mp_size_t, mp_size_t, int) ATTRIBUTE_CONST;

#define   mpn_preinv_mu_div_qr __MPN(preinv_mu_div_qr)
__GMP_DECLSPEC mp_limb_t mpn_preinv_mu_div_qr (mp_ptr, mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t, mp_ptr);
#define   mpn_preinv_mu_div_qr_itch __MPN(preinv_mu_div_qr_itch)
__GMP_DECLSPEC mp_size_t mpn_preinv_mu_div_qr_itch (mp_size_t, mp_size_t, mp_size_t) ATTRIBUTE_CONST;

#define   mpn_mu_divappr_q __MPN(mu_divappr_q)
__GMP_DECLSPEC mp_limb_t mpn_mu_divappr_q (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t, mp_ptr);
#define   mpn_mu_divappr_q_itch __MPN(mu_divappr_q_itch)
__GMP_DECLSPEC mp_size_t mpn_mu_divappr_q_itch (mp_size_t, mp_size_t, int) ATTRIBUTE_CONST;

#define   mpn_mu_div_q __MPN(mu_div_q)
__GMP_DECLSPEC mp_limb_t mpn_mu_div_q (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t, mp_ptr);
#define   mpn_mu_div_q_itch __MPN(mu_div_q_itch)
__GMP_DECLSPEC mp_size_t mpn_mu_div_q_itch (mp_size_t, mp_size_t, int) ATTRIBUTE_CONST;

#define  mpn_div_q __MPN(div_q)
__GMP_DECLSPEC void mpn_div_q (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t, mp_ptr);

#define   mpn_invert __MPN(invert)
__GMP_DECLSPEC void      mpn_invert (mp_ptr, mp_srcptr, mp_size_t, mp_ptr);
#define mpn_invert_itch(n)  mpn_invertappr_itch(n)

#define   mpn_ni_invertappr __MPN(ni_invertappr)
__GMP_DECLSPEC mp_limb_t mpn_ni_invertappr (mp_ptr, mp_srcptr, mp_size_t, mp_ptr);
#define   mpn_invertappr __MPN(invertappr)
__GMP_DECLSPEC mp_limb_t mpn_invertappr (mp_ptr, mp_srcptr, mp_size_t, mp_ptr);
#define mpn_invertappr_itch(n)  (2 * (n))

#define   mpn_binvert __MPN(binvert)
__GMP_DECLSPEC void      mpn_binvert (mp_ptr, mp_srcptr, mp_size_t, mp_ptr);
#define   mpn_binvert_itch __MPN(binvert_itch)
__GMP_DECLSPEC mp_size_t mpn_binvert_itch (mp_size_t) ATTRIBUTE_CONST;

#define mpn_bdiv_q_1 __MPN(bdiv_q_1)
__GMP_DECLSPEC mp_limb_t mpn_bdiv_q_1 (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t);

#define mpn_pi1_bdiv_q_1 __MPN(pi1_bdiv_q_1)
__GMP_DECLSPEC mp_limb_t mpn_pi1_bdiv_q_1 (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t, mp_limb_t, int);

#define   mpn_sbpi1_bdiv_qr __MPN(sbpi1_bdiv_qr)
__GMP_DECLSPEC mp_limb_t mpn_sbpi1_bdiv_qr (mp_ptr, mp_ptr, mp_size_t, mp_srcptr, mp_size_t, mp_limb_t);

#define   mpn_sbpi1_bdiv_q __MPN(sbpi1_bdiv_q)
__GMP_DECLSPEC void      mpn_sbpi1_bdiv_q (mp_ptr, mp_ptr, mp_size_t, mp_srcptr, mp_size_t, mp_limb_t);

#define   mpn_sbpi1_bdiv_r __MPN(sbpi1_bdiv_r)
__GMP_DECLSPEC mp_limb_t mpn_sbpi1_bdiv_r (mp_ptr, mp_size_t, mp_srcptr, mp_size_t, mp_limb_t);

#define   mpn_dcpi1_bdiv_qr __MPN(dcpi1_bdiv_qr)
__GMP_DECLSPEC mp_limb_t mpn_dcpi1_bdiv_qr (mp_ptr, mp_ptr, mp_size_t, mp_srcptr, mp_size_t, mp_limb_t);
#define   mpn_dcpi1_bdiv_qr_n_itch __MPN(dcpi1_bdiv_qr_n_itch)
__GMP_DECLSPEC mp_size_t mpn_dcpi1_bdiv_qr_n_itch (mp_size_t) ATTRIBUTE_CONST;

#define   mpn_dcpi1_bdiv_qr_n __MPN(dcpi1_bdiv_qr_n)
__GMP_DECLSPEC mp_limb_t mpn_dcpi1_bdiv_qr_n (mp_ptr, mp_ptr, mp_srcptr, mp_size_t, mp_limb_t, mp_ptr);
#define   mpn_dcpi1_bdiv_q __MPN(dcpi1_bdiv_q)
--> --------------------

--> maximum size reached

--> --------------------

76%


¤ Dauer der Verarbeitung: 0.25 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung ist noch experimentell.