Back to index

plt-scheme  4.2.1
Classes | Defines | Typedefs | Functions | Variables
gmp-impl.h File Reference
#include "gmp-mparam.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  tmp_stack
struct  tmp_marker
struct  bases

Defines

#define PACKAGE   "gmp"
#define HAVE_VOID   1
#define HAVE_STRINGIZE   1
#define VERSION   "3.1.1"
#define __TMP_ALIGN   8
#define TMP_DECL(marker)   tmp_marker marker
#define TMP_ALLOC(size)   __gmp_tmp_alloc (((unsigned long) (size) + __TMP_ALIGN - 1) & -__TMP_ALIGN)
#define TMP_MARK(marker)   __gmp_tmp_mark (&marker)
#define TMP_FREE(marker)   __gmp_tmp_free (&marker)
#define TMP_ALLOC_TYPE(n, type)   ((type *) TMP_ALLOC ((n) * sizeof (type)))
#define TMP_ALLOC_LIMBS(n)   TMP_ALLOC_TYPE(n,mp_limb_t)
#define TMP_ALLOC_MP_PTRS(n)   TMP_ALLOC_TYPE(n,mp_ptr)
#define inline   /* Empty */
#define ABS(x)   (x >= 0 ? x : -x)
#define MIN(l, o)   ((l) < (o) ? (l) : (o))
#define MAX(h, i)   ((h) > (i) ? (h) : (i))
#define numberof(x)   (sizeof (x) / sizeof ((x)[0]))
#define SIZ(x)   ((x)->_mp_size)
#define ABSIZ(x)   ABS (SIZ (x))
#define PTR(x)   ((x)->_mp_d)
#define LIMBS(x)   ((x)->_mp_d)
#define EXP(x)   ((x)->_mp_exp)
#define PREC(x)   ((x)->_mp_prec)
#define ALLOC(x)   ((x)->_mp_alloc)
#define UNSIGNED_TYPE_MAX(type)   ((type) ~ (type) 0)
#define UNSIGNED_TYPE_HIGHBIT(type)   ((type) ~ (UNSIGNED_TYPE_MAX(type) >> 1))
#define SIGNED_TYPE_MIN(type)   (((type) -1) << (8*sizeof(type)-1))
#define SIGNED_TYPE_MAX(type)   ((type) ~ SIGNED_TYPE_MIN(type))
#define SIGNED_TYPE_HIGHBIT(type)   SIGNED_TYPE_MIN(type)
#define MP_LIMB_T_MAX   UNSIGNED_TYPE_MAX (mp_limb_t)
#define MP_LIMB_T_HIGHBIT   UNSIGNED_TYPE_HIGHBIT (mp_limb_t)
#define MP_SIZE_T_MAX   SIGNED_TYPE_MAX (mp_size_t)
#define ULONG_MAX   UNSIGNED_TYPE_MAX (unsigned long)
#define ULONG_HIGHBIT   UNSIGNED_TYPE_HIGHBIT (unsigned long)
#define LONG_HIGHBIT   SIGNED_TYPE_HIGHBIT (long)
#define LONG_MAX   SIGNED_TYPE_MAX (long)
#define USHORT_MAX   UNSIGNED_TYPE_MAX (unsigned short)
#define USHORT_HIGHBIT   UNSIGNED_TYPE_HIGHBIT (unsigned short)
#define SHORT_HIGHBIT   SIGNED_TYPE_HIGHBIT (short)
#define SHORT_MAX   SIGNED_TYPE_MAX (short)
#define MP_LIMB_T_SWAP(x, y)
#define MP_SIZE_T_SWAP(x, y)
#define MP_PTR_SWAP(x, y)
#define MP_SRCPTR_SWAP(x, y)
#define MPN_PTR_SWAP(xp, xs, yp, ys)
#define MPN_SRCPTR_SWAP(xp, xs, yp, ys)
#define MPZ_PTR_SWAP(x, y)
#define MPZ_SRCPTR_SWAP(x, y)
#define _mp_allocate_func   __gmp_allocate_func
#define _mp_reallocate_func   __gmp_reallocate_func
#define _mp_free_func   __gmp_free_func
#define _mp_default_allocate   __gmp_default_allocate
#define _mp_default_reallocate   __gmp_default_reallocate
#define _mp_default_free   __gmp_default_free
#define _MP_ALLOCATE_FUNC_TYPE(n, type)   ((type *) (*_mp_allocate_func) ((n) * sizeof (type)))
#define _MP_ALLOCATE_FUNC_LIMBS(n)   _MP_ALLOCATE_FUNC_TYPE(n,mp_limb_t)
#define _MP_FREE_FUNC_TYPE(p, n, type)   (*_mp_free_func) (p, (n) * sizeof (type))
#define _MP_FREE_FUNC_LIMBS(p, n)   _MP_FREE_FUNC_TYPE(p,n,mp_limb_t)
#define const   /* Empty */
#define signed   /* Empty */
#define __clz_tab   __MPN(clz_tab)
#define mpn_udiv_w_sdiv   __MPN(udiv_w_sdiv)
#define mpn_reciprocal   __MPN(reciprocal)
#define mpn_sb_divrem_mn   __MPN(sb_divrem_mn)
#define mpn_bz_divrem_n   __MPN(bz_divrem_n)
#define mpn_kara_mul_n   __MPN(kara_mul_n)
#define mpn_kara_sqr_n   __MPN(kara_sqr_n)
#define mpn_toom3_mul_n   __MPN(toom3_mul_n)
#define mpn_toom3_sqr_n   __MPN(toom3_sqr_n)
#define mpn_fft_best_k   __MPN(fft_best_k)
#define mpn_mul_fft   __MPN(mul_fft)
#define mpn_mul_fft_full   __MPN(mul_fft_full)
#define mpn_fft_next_size   __MPN(fft_next_size)
#define MPN_COPY_INCR(DST, SRC, NLIMBS)
#define MPN_COPY_DECR(DST, SRC, NLIMBS)
#define MPN_COPY   MPN_COPY_INCR
#define MPN_ZERO(DST, NLIMBS)
#define MPN_NORMALIZE(DST, NLIMBS)
#define MPN_NORMALIZE_NOT_ZERO(DST, NLIMBS)
#define MPN_STRIP_LOW_ZEROS_NOT_ZERO(ptr, size)
#define MPZ_TMP_INIT(X, NLIMBS)
#define MPZ_REALLOC(what, needed)
#define KARATSUBA_MUL_THRESHOLD   32
#define TOOM3_MUL_THRESHOLD   256
#define KARATSUBA_SQR_THRESHOLD   (2*KARATSUBA_MUL_THRESHOLD)
#define TOOM3_SQR_THRESHOLD   (2*TOOM3_MUL_THRESHOLD)
#define FFT_FIRST_K   4
#define FFT_MODF_MUL_THRESHOLD   (TOOM3_MUL_THRESHOLD * 3)
#define FFT_MODF_SQR_THRESHOLD   (TOOM3_SQR_THRESHOLD * 3)
#define FFT_MUL_THRESHOLD   (FFT_MODF_MUL_THRESHOLD * 10)
#define FFT_SQR_THRESHOLD   (FFT_MODF_SQR_THRESHOLD * 10)
#define FFT_MUL_TABLE
#define FFT_SQR_TABLE
#define FFT_TABLE_ATTRS   static const
#define MPN_FFT_TABLE_SIZE   16
#define MPN_OVERLAP_P(xp, xsize, yp, ysize)   ((xp) + (xsize) > (yp) && (yp) + (ysize) > (xp))
#define ASSERT_LINE   -1
#define ASSERT_FILE   ""
#define ASSERT_FAIL(expr)   __gmp_assert_fail (ASSERT_FILE, ASSERT_LINE, #expr)
#define CAST_TO_VOID   (void)
#define ASSERT_ALWAYS(expr)   ((expr) ? 0 : ASSERT_FAIL (expr))
#define ASSERT(expr)   (CAST_TO_VOID 0)
#define ASSERT_NOCARRY(expr)   (expr)
#define mpn_com_n(d, s, n)
#define MPN_LOGOPS_N_INLINE(d, s1, s2, n, dop, op, s2op)
#define mpn_and_n(d, s1, s2, n)   MPN_LOGOPS_N_INLINE(d,s1,s2,n, ,&, )
#define mpn_andn_n(d, s1, s2, n)   MPN_LOGOPS_N_INLINE(d,s1,s2,n, ,&,~)
#define mpn_nand_n(d, s1, s2, n)   MPN_LOGOPS_N_INLINE(d,s1,s2,n,~,&, )
#define mpn_ior_n(d, s1, s2, n)   MPN_LOGOPS_N_INLINE(d,s1,s2,n, ,|, )
#define mpn_iorn_n(d, s1, s2, n)   MPN_LOGOPS_N_INLINE(d,s1,s2,n, ,|,~)
#define mpn_nior_n(d, s1, s2, n)   MPN_LOGOPS_N_INLINE(d,s1,s2,n,~,|, )
#define mpn_xor_n(d, s1, s2, n)   MPN_LOGOPS_N_INLINE(d,s1,s2,n, ,^, )
#define mpn_xnor_n(d, s1, s2, n)   MPN_LOGOPS_N_INLINE(d,s1,s2,n,~,^, )
#define __mp_bases   __MPN(mp_bases)
#define TARGET_REGISTER_STARVED   0
#define invert_limb(invxl, xl)
#define udiv_qrnnd_preinv(q, r, nh, nl, d, di)
#define udiv_qrnnd_preinv2gen(q, r, nh, nl, d, di, dnorm, lgup)
#define udiv_qrnnd_preinv2norm(q, r, nh, nl, d, di)
#define modlimb_invert_table   __gmp_modlimb_invert_table
#define modlimb_invert(inv, n)
#define W_TYPE_SIZE   BITS_PER_MP_LIMB
#define MP_BASE_AS_DOUBLE   (4.0 * ((mp_limb_t) 1 << (BITS_PER_MP_LIMB - 2)))
#define LIMBS_PER_DOUBLE   3
#define GMP_ERROR(code)   (gmp_errno |= (code), __gmp_junk = 10/__gmp_0)
#define DIVIDE_BY_ZERO   GMP_ERROR(GMP_ERROR_DIVISION_BY_ZERO)
#define SQRT_OF_NEGATIVE   GMP_ERROR(GMP_ERROR_SQRT_OF_NEGATIVE)
#define CNST_LIMB(C)   CL
#define PP   0xC0CFD797L /* 3 x 5 x 7 x 11 x 13 x ... x 29 */
#define PP_INVERTED   0x53E5645CL
#define PP_MAXPRIME   29
#define PP_MASK   0x208A28A8L
#define JACOBI_S0(a)   (((a) == 1) | ((a) == -1))
#define JACOBI_U0(a)   ((a) == 1)
#define JACOBI_Z0(a)   (((SIZ(a) == 1) | (SIZ(a) == -1)) & (PTR(a)[0] == 1))
#define JACOBI_BIT1_TO_PN(result_bit1)   (1 - ((result_bit1) & 2))
#define JACOBI_TWO_U_BIT1(b)   (ASSERT (b & 1), (((b) >> 1) ^ (b)))
#define JACOBI_TWOS_U_BIT1(twos, b)   (((twos) << 1) & JACOBI_TWO_U_BIT1 (b))
#define JACOBI_TWOS_U(twos, b)   (JACOBI_BIT1_TO_PN (JACOBI_TWOS_U_BIT1 (twos, b)))
#define JACOBI_ASGN_SU_BIT1(a, b)   ((((a) < 0) << 1) & (b))
#define JACOBI_BSGN_SZ_BIT1(a, b)   ((((a) < 0) & (SIZ(b) < 0)) << 1)
#define JACOBI_BSGN_ZS_BIT1(a, b)   JACOBI_BSGN_SZ_BIT1(b, a)
#define JACOBI_RECIP_UU_BIT1(a, b)   ((a) & (b))
#define MPZ_CHECK_FORMAT(z)
#define MPZ_PROVOKE_REALLOC(z)   do { ALLOC(z) = ABSIZ(z); } while (0)

Typedefs

typedef struct tmp_marker
typedef unsigned char UQItype
typedef long SItype
typedef unsigned long USItype
typedef long int DItype
typedef unsigned long int UDItype
typedef mp_limb_t UWtype
typedef unsigned int UHWtype

Functions

void__gmp_tmp_alloc ()
void __gmp_tmp_mark ()
void __gmp_tmp_free ()
void *_mp_allocate_func _PROTO ((size_t))
void *_mp_reallocate_func _PROTO ((void *, size_t, size_t))
void _mp_free_func _PROTO ((void *, size_t))
void mpn_kara_mul_n _PROTO ((mp_ptr, mp_srcptr, mp_srcptr, mp_size_t, mp_ptr))
void mpn_kara_sqr_n _PROTO ((mp_ptr, mp_srcptr, mp_size_t, mp_ptr))
int mpn_fft_best_k _PROTO ((mp_size_t n, int sqr))
void mpn_mul_fft _PROTO ((mp_ptr op, mp_size_t pl, mp_srcptr n, mp_size_t nl, mp_srcptr m, mp_size_t ml, int k))
void mpn_mul_fft_full _PROTO ((mp_ptr op, mp_srcptr n, mp_size_t nl, mp_srcptr m, mp_size_t ml))
mp_size_t mpn_fft_next_size _PROTO ((mp_size_t pl, int k))
mp_limb_t mpn_sb_divrem_mn _PROTO ((mp_ptr, mp_ptr, mp_size_t, mp_srcptr, mp_size_t))
mp_limb_t mpn_bz_divrem_n _PROTO ((mp_ptr, mp_ptr, mp_srcptr, mp_size_t))
static int __gmp_assert_fail _PROTO ((const char *filename, int linenum, const char *expr))
double __gmp_scale2 _PROTO ((double, int))
int __gmp_extract_double _PROTO ((mp_ptr, double))

Variables

mp_size_t __gmp_default_fp_limb_precision
const unsigned char modlimb_invert_table [128]
int __gmp_junk
const int __gmp_0

Class Documentation

struct tmp_stack

Definition at line 101 of file gmp-impl.h.

Collaboration diagram for tmp_stack:
Class Members
void * alloc_point
void * end
struct tmp_stack * prev
struct tmp_marker

Definition at line 108 of file gmp-impl.h.

Collaboration diagram for tmp_marker:
Class Members
void * alloc_point
struct tmp_stack * which_chunk
struct bases

Definition at line 698 of file gmp-impl.h.

Class Members
mp_limb_t big_base
mp_limb_t big_base_inverted
double chars_per_bit_exactly
int chars_per_limb

Define Documentation

#define __clz_tab   __MPN(clz_tab)

Definition at line 317 of file gmp-impl.h.

#define __mp_bases   __MPN(mp_bases)

Definition at line 719 of file gmp-impl.h.

#define __TMP_ALIGN   8

Definition at line 127 of file gmp-impl.h.

#define _mp_allocate_func   __gmp_allocate_func

Definition at line 259 of file gmp-impl.h.

Definition at line 276 of file gmp-impl.h.

#define _MP_ALLOCATE_FUNC_TYPE (   n,
  type 
)    ((type *) (*_mp_allocate_func) ((n) * sizeof (type)))

Definition at line 274 of file gmp-impl.h.

#define _mp_default_allocate   __gmp_default_allocate

Definition at line 262 of file gmp-impl.h.

#define _mp_default_free   __gmp_default_free

Definition at line 264 of file gmp-impl.h.

#define _mp_default_reallocate   __gmp_default_reallocate

Definition at line 263 of file gmp-impl.h.

#define _mp_free_func   __gmp_free_func

Definition at line 261 of file gmp-impl.h.

#define _MP_FREE_FUNC_LIMBS (   p,
 
)    _MP_FREE_FUNC_TYPE(p,n,mp_limb_t)

Definition at line 279 of file gmp-impl.h.

#define _MP_FREE_FUNC_TYPE (   p,
  n,
  type 
)    (*_mp_free_func) (p, (n) * sizeof (type))

Definition at line 278 of file gmp-impl.h.

#define _mp_reallocate_func   __gmp_reallocate_func

Definition at line 260 of file gmp-impl.h.

#define ABS (   x)    (x >= 0 ? x : -x)

Definition at line 153 of file gmp-impl.h.

#define ABSIZ (   x)    ABS (SIZ (x))

Definition at line 160 of file gmp-impl.h.

#define ALLOC (   x)    ((x)->_mp_alloc)

Definition at line 165 of file gmp-impl.h.

#define ASSERT (   expr)    (CAST_TO_VOID 0)

Definition at line 605 of file gmp-impl.h.

#define ASSERT_ALWAYS (   expr)    ((expr) ? 0 : ASSERT_FAIL (expr))

Definition at line 598 of file gmp-impl.h.

#define ASSERT_FAIL (   expr)    __gmp_assert_fail (ASSERT_FILE, ASSERT_LINE, #expr)

Definition at line 587 of file gmp-impl.h.

#define ASSERT_FILE   ""

Definition at line 580 of file gmp-impl.h.

#define ASSERT_LINE   -1

Definition at line 574 of file gmp-impl.h.

#define ASSERT_NOCARRY (   expr)    (expr)

Definition at line 606 of file gmp-impl.h.

#define CAST_TO_VOID   (void)

Definition at line 593 of file gmp-impl.h.

#define CNST_LIMB (   C)    CL

Definition at line 992 of file gmp-impl.h.

#define const   /* Empty */

Definition at line 286 of file gmp-impl.h.

Definition at line 979 of file gmp-impl.h.

#define EXP (   x)    ((x)->_mp_exp)

Definition at line 163 of file gmp-impl.h.

#define FFT_FIRST_K   4

Definition at line 500 of file gmp-impl.h.

Definition at line 504 of file gmp-impl.h.

Definition at line 507 of file gmp-impl.h.

#define FFT_MUL_TABLE
Value:
{ TOOM3_MUL_THRESHOLD * 4,   /* k=5 */        \
    TOOM3_MUL_THRESHOLD * 8,   /* k=6 */        \
    TOOM3_MUL_THRESHOLD * 16,  /* k=7 */        \
    TOOM3_MUL_THRESHOLD * 32,  /* k=8 */        \
    TOOM3_MUL_THRESHOLD * 96,  /* k=9 */        \
    TOOM3_MUL_THRESHOLD * 288, /* k=10 */       \
    0 }

Definition at line 526 of file gmp-impl.h.

Definition at line 516 of file gmp-impl.h.

#define FFT_SQR_TABLE
Value:
{ TOOM3_SQR_THRESHOLD * 4,   /* k=5 */        \
    TOOM3_SQR_THRESHOLD * 8,   /* k=6 */        \
    TOOM3_SQR_THRESHOLD * 16,  /* k=7 */        \
    TOOM3_SQR_THRESHOLD * 32,  /* k=8 */        \
    TOOM3_SQR_THRESHOLD * 96,  /* k=9 */        \
    TOOM3_SQR_THRESHOLD * 288, /* k=10 */       \
    0 }

Definition at line 536 of file gmp-impl.h.

Definition at line 519 of file gmp-impl.h.

#define FFT_TABLE_ATTRS   static const

Definition at line 547 of file gmp-impl.h.

#define GMP_ERROR (   code)    (gmp_errno |= (code), __gmp_junk = 10/__gmp_0)

Definition at line 978 of file gmp-impl.h.

#define HAVE_STRINGIZE   1

Definition at line 56 of file gmp-impl.h.

#define HAVE_VOID   1

Definition at line 53 of file gmp-impl.h.

#define inline   /* Empty */

Definition at line 150 of file gmp-impl.h.

#define invert_limb (   invxl,
  xl 
)
Value:
do {                                                           \
    mp_limb_t dummy;                                           \
    if (xl << 1 == 0)                                                 \
      invxl = ~(mp_limb_t) 0;                                         \
    else								\
      udiv_qrnnd (invxl, dummy, -xl, 0, xl);                          \
  } while (0)

Definition at line 737 of file gmp-impl.h.

#define JACOBI_ASGN_SU_BIT1 (   a,
  b 
)    ((((a) < 0) << 1) & (b))

Definition at line 1055 of file gmp-impl.h.

#define JACOBI_BIT1_TO_PN (   result_bit1)    (1 - ((result_bit1) & 2))

Definition at line 1036 of file gmp-impl.h.

#define JACOBI_BSGN_SZ_BIT1 (   a,
  b 
)    ((((a) < 0) & (SIZ(b) < 0)) << 1)

Definition at line 1060 of file gmp-impl.h.

#define JACOBI_BSGN_ZS_BIT1 (   a,
  b 
)    JACOBI_BSGN_SZ_BIT1(b, a)

Definition at line 1064 of file gmp-impl.h.

#define JACOBI_RECIP_UU_BIT1 (   a,
  b 
)    ((a) & (b))

Definition at line 1072 of file gmp-impl.h.

#define JACOBI_S0 (   a)    (((a) == 1) | ((a) == -1))

Definition at line 1022 of file gmp-impl.h.

#define JACOBI_TWO_U_BIT1 (   b)    (ASSERT (b & 1), (((b) >> 1) ^ (b)))

Definition at line 1042 of file gmp-impl.h.

#define JACOBI_TWOS_U (   twos,
  b 
)    (JACOBI_BIT1_TO_PN (JACOBI_TWOS_U_BIT1 (twos, b)))

Definition at line 1050 of file gmp-impl.h.

#define JACOBI_TWOS_U_BIT1 (   twos,
  b 
)    (((twos) << 1) & JACOBI_TWO_U_BIT1 (b))

Definition at line 1046 of file gmp-impl.h.

#define JACOBI_U0 (   a)    ((a) == 1)

Definition at line 1026 of file gmp-impl.h.

#define JACOBI_Z0 (   a)    (((SIZ(a) == 1) | (SIZ(a) == -1)) & (PTR(a)[0] == 1))

Definition at line 1032 of file gmp-impl.h.

#define KARATSUBA_MUL_THRESHOLD   32

Definition at line 480 of file gmp-impl.h.

Definition at line 490 of file gmp-impl.h.

#define LIMBS (   x)    ((x)->_mp_d)

Definition at line 162 of file gmp-impl.h.

#define LIMBS_PER_DOUBLE   3

Definition at line 970 of file gmp-impl.h.

#define LONG_HIGHBIT   SIGNED_TYPE_HIGHBIT (long)

Definition at line 185 of file gmp-impl.h.

#define LONG_MAX   SIGNED_TYPE_MAX (long)

Definition at line 187 of file gmp-impl.h.

#define MAX (   h,
  i 
)    ((h) > (i) ? (h) : (i))

Definition at line 155 of file gmp-impl.h.

#define MIN (   l,
 
)    ((l) < (o) ? (l) : (o))

Definition at line 154 of file gmp-impl.h.

#define modlimb_invert (   inv,
 
)
Value:
do {                                                          \
    mp_limb_t  __n = (n);                                       \
    mp_limb_t  __inv;                                           \
    ASSERT ((__n & 1) == 1);                                    \
    __inv = modlimb_invert_table[(__n&0xFF)/2]; /*  8 */        \
    __inv = 2 * __inv - __inv * __inv * __n;    /* 16 */        \
    __inv = 2 * __inv - __inv * __inv * __n;    /* 32 */        \
    ASSERT (__inv * __n == 1);                                  \
    (inv) = __inv;                                              \
  } while (0)

Definition at line 833 of file gmp-impl.h.

#define modlimb_invert_table   __gmp_modlimb_invert_table

Definition at line 829 of file gmp-impl.h.

#define MP_BASE_AS_DOUBLE   (4.0 * ((mp_limb_t) 1 << (BITS_PER_MP_LIMB - 2)))

Definition at line 966 of file gmp-impl.h.

Definition at line 177 of file gmp-impl.h.

Definition at line 176 of file gmp-impl.h.

#define MP_LIMB_T_SWAP (   x,
  y 
)
Value:
do {                                          \
    mp_limb_t __mp_limb_t_swap__tmp = (x);      \
    (x) = (y);                                  \
    (y) = __mp_limb_t_swap__tmp;                \
  } while (0)

Definition at line 202 of file gmp-impl.h.

#define MP_PTR_SWAP (   x,
  y 
)
Value:
do {                                  \
    mp_ptr __mp_ptr_swap__tmp = (x);    \
    (x) = (y);                          \
    (y) = __mp_ptr_swap__tmp;           \
  } while (0)

Definition at line 215 of file gmp-impl.h.

Definition at line 179 of file gmp-impl.h.

#define MP_SIZE_T_SWAP (   x,
  y 
)
Value:
do {                                          \
    mp_size_t __mp_size_t_swap__tmp = (x);      \
    (x) = (y);                                  \
    (y) = __mp_size_t_swap__tmp;                \
  } while (0)

Definition at line 208 of file gmp-impl.h.

#define MP_SRCPTR_SWAP (   x,
  y 
)
Value:
do {                                          \
    mp_srcptr __mp_srcptr_swap__tmp = (x);      \
    (x) = (y);                                  \
    (y) = __mp_srcptr_swap__tmp;                \
  } while (0)

Definition at line 221 of file gmp-impl.h.

#define mpn_and_n (   d,
  s1,
  s2,
 
)    MPN_LOGOPS_N_INLINE(d,s1,s2,n, ,&, )

Definition at line 644 of file gmp-impl.h.

#define mpn_andn_n (   d,
  s1,
  s2,
 
)    MPN_LOGOPS_N_INLINE(d,s1,s2,n, ,&,~)

Definition at line 651 of file gmp-impl.h.

#define mpn_bz_divrem_n   __MPN(bz_divrem_n)

Definition at line 322 of file gmp-impl.h.

#define mpn_com_n (   d,
  s,
 
)
Value:
do                            \
    {                           \
      mp_ptr     __d = (d);     \
      mp_srcptr  __s = (s);     \
      mp_size_t  __n = (n);     \
      do                        \
        *__d++ = ~ *__s++;      \
      while (--__n);            \
    }                           \
  while (0)

Definition at line 614 of file gmp-impl.h.

#define MPN_COPY   MPN_COPY_INCR

Definition at line 407 of file gmp-impl.h.

#define MPN_COPY_DECR (   DST,
  SRC,
  NLIMBS 
)
Value:
do {                                                           \
    mp_size_t __i;                                             \
    for (__i = (NLIMBS) - 1; __i >= 0; __i--)                         \
      (DST)[__i] = (SRC)[__i];                                        \
  } while (0)

Definition at line 382 of file gmp-impl.h.

#define MPN_COPY_INCR (   DST,
  SRC,
  NLIMBS 
)
Value:
do {                                                           \
    mp_size_t __i;                                             \
    for (__i = 0; __i < (NLIMBS); __i++)                       \
      (DST)[__i] = (SRC)[__i];                                        \
  } while (0)

Definition at line 363 of file gmp-impl.h.

#define mpn_fft_best_k   __MPN(fft_best_k)

Definition at line 337 of file gmp-impl.h.

#define mpn_fft_next_size   __MPN(fft_next_size)

Definition at line 351 of file gmp-impl.h.

#define MPN_FFT_TABLE_SIZE   16

Definition at line 550 of file gmp-impl.h.

#define mpn_ior_n (   d,
  s1,
  s2,
 
)    MPN_LOGOPS_N_INLINE(d,s1,s2,n, ,|, )

Definition at line 665 of file gmp-impl.h.

#define mpn_iorn_n (   d,
  s1,
  s2,
 
)    MPN_LOGOPS_N_INLINE(d,s1,s2,n, ,|,~)

Definition at line 672 of file gmp-impl.h.

#define mpn_kara_mul_n   __MPN(kara_mul_n)

Definition at line 325 of file gmp-impl.h.

#define mpn_kara_sqr_n   __MPN(kara_sqr_n)

Definition at line 328 of file gmp-impl.h.

#define MPN_LOGOPS_N_INLINE (   d,
  s1,
  s2,
  n,
  dop,
  op,
  s2op 
)
Value:
do                                                    \
    {                                                   \
      mp_ptr     __d = (d);                             \
      mp_srcptr  __s1 = (s1);                           \
      mp_srcptr  __s2 = (s2);                           \
      mp_size_t  __n = (n);                             \
      do                                                \
        *__d++ = dop (*__s1++ op s2op *__s2++);         \
      while (--__n);                                    \
    }                                                   \
  while (0)

Definition at line 627 of file gmp-impl.h.

#define mpn_mul_fft   __MPN(mul_fft)

Definition at line 340 of file gmp-impl.h.

#define mpn_mul_fft_full   __MPN(mul_fft_full)

Definition at line 346 of file gmp-impl.h.

#define mpn_nand_n (   d,
  s1,
  s2,
 
)    MPN_LOGOPS_N_INLINE(d,s1,s2,n,~,&, )

Definition at line 658 of file gmp-impl.h.

#define mpn_nior_n (   d,
  s1,
  s2,
 
)    MPN_LOGOPS_N_INLINE(d,s1,s2,n,~,|, )

Definition at line 679 of file gmp-impl.h.

#define MPN_NORMALIZE (   DST,
  NLIMBS 
)
Value:
do {                                                           \
    while (NLIMBS > 0)                                                \
      {                                                               \
       if ((DST)[(NLIMBS) - 1] != 0)                                  \
         break;                                                \
       NLIMBS--;                                               \
      }                                                               \
  } while (0)

Definition at line 421 of file gmp-impl.h.

#define MPN_NORMALIZE_NOT_ZERO (   DST,
  NLIMBS 
)
Value:
do {                                                           \
    while (1)                                                  \
      {                                                               \
       if ((DST)[(NLIMBS) - 1] != 0)                                  \
         break;                                                \
       NLIMBS--;                                               \
      }                                                               \
  } while (0)

Definition at line 432 of file gmp-impl.h.

#define MPN_OVERLAP_P (   xp,
  xsize,
  yp,
  ysize 
)    ((xp) + (xsize) > (yp) && (yp) + (ysize) > (xp))

Definition at line 556 of file gmp-impl.h.

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

Definition at line 228 of file gmp-impl.h.

#define mpn_reciprocal   __MPN(reciprocal)

Definition at line 319 of file gmp-impl.h.

#define mpn_sb_divrem_mn   __MPN(sb_divrem_mn)

Definition at line 321 of file gmp-impl.h.

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

Definition at line 233 of file gmp-impl.h.

#define MPN_STRIP_LOW_ZEROS_NOT_ZERO (   ptr,
  size 
)
Value:
do                                            \
    {                                           \
      ASSERT ((size) != 0);                     \
      while ((ptr)[0] == 0)                     \
        {                                       \
          (ptr)++;                              \
          (size)--;                             \
          ASSERT (size >= 0);                   \
       }                                       \
    }                                           \
  while (0)

Definition at line 446 of file gmp-impl.h.

#define mpn_toom3_mul_n   __MPN(toom3_mul_n)

Definition at line 331 of file gmp-impl.h.

#define mpn_toom3_sqr_n   __MPN(toom3_sqr_n)

Definition at line 334 of file gmp-impl.h.

#define mpn_udiv_w_sdiv   __MPN(udiv_w_sdiv)

Definition at line 318 of file gmp-impl.h.

#define mpn_xnor_n (   d,
  s1,
  s2,
 
)    MPN_LOGOPS_N_INLINE(d,s1,s2,n,~,^, )

Definition at line 693 of file gmp-impl.h.

#define mpn_xor_n (   d,
  s1,
  s2,
 
)    MPN_LOGOPS_N_INLINE(d,s1,s2,n, ,^, )

Definition at line 686 of file gmp-impl.h.

#define MPN_ZERO (   DST,
  NLIMBS 
)
Value:
do {                                                           \
    mp_size_t __i;                                             \
    for (__i = 0; __i < (NLIMBS); __i++)                       \
      (DST)[__i] = 0;                                                 \
  } while (0)

Definition at line 412 of file gmp-impl.h.

#define MPZ_CHECK_FORMAT (   z)
Value:
(ASSERT_ALWAYS (SIZ(z) == 0 || PTR(z)[ABSIZ(z) - 1] != 0),     \
   ASSERT_ALWAYS (ALLOC(z) >= ABSIZ(z)))

Definition at line 1077 of file gmp-impl.h.

#define MPZ_PROVOKE_REALLOC (   z)    do { ALLOC(z) = ABSIZ(z); } while (0)

Definition at line 1080 of file gmp-impl.h.

#define MPZ_PTR_SWAP (   x,
  y 
)
Value:
do {                                  \
    mpz_ptr __mpz_ptr_swap__tmp = (x);  \
    (x) = (y);                          \
    (y) = __mpz_ptr_swap__tmp;          \
  } while (0)

Definition at line 239 of file gmp-impl.h.

#define MPZ_REALLOC (   what,
  needed 
)
Value:
do {                                                    \
    if ((needed) > ALLOC (what))                        \
      _mpz_realloc (what, needed);                      \
  } while (0)

Definition at line 471 of file gmp-impl.h.

#define MPZ_SRCPTR_SWAP (   x,
  y 
)
Value:
do {                                          \
    mpz_srcptr __mpz_srcptr_swap__tmp = (x);    \
    (x) = (y);                                  \
    (y) = __mpz_srcptr_swap__tmp;               \
  } while (0)

Definition at line 245 of file gmp-impl.h.

#define MPZ_TMP_INIT (   X,
  NLIMBS 
)
Value:
do {                                                           \
    mpz_ptr __x = (X);                                                \
    __x->_mp_alloc = (NLIMBS);                                        \
    __x->_mp_d = (mp_ptr) TMP_ALLOC ((NLIMBS) * BYTES_PER_MP_LIMB);   \
  } while (0)

Definition at line 463 of file gmp-impl.h.

#define numberof (   x)    (sizeof (x) / sizeof ((x)[0]))

Definition at line 156 of file gmp-impl.h.

#define PACKAGE   "gmp"

Definition at line 50 of file gmp-impl.h.

#define PP   0xC0CFD797L /* 3 x 5 x 7 x 11 x 13 x ... x 29 */

Definition at line 998 of file gmp-impl.h.

#define PP_INVERTED   0x53E5645CL

Definition at line 999 of file gmp-impl.h.

#define PP_MASK   0x208A28A8L

Definition at line 1001 of file gmp-impl.h.

#define PP_MAXPRIME   29

Definition at line 1000 of file gmp-impl.h.

#define PREC (   x)    ((x)->_mp_prec)

Definition at line 164 of file gmp-impl.h.

#define PTR (   x)    ((x)->_mp_d)

Definition at line 161 of file gmp-impl.h.

#define SHORT_HIGHBIT   SIGNED_TYPE_HIGHBIT (short)

Definition at line 194 of file gmp-impl.h.

#define SHORT_MAX   SIGNED_TYPE_MAX (short)

Definition at line 196 of file gmp-impl.h.

#define signed   /* Empty */

Definition at line 287 of file gmp-impl.h.

Definition at line 174 of file gmp-impl.h.

#define SIGNED_TYPE_MAX (   type)    ((type) ~ SIGNED_TYPE_MIN(type))

Definition at line 173 of file gmp-impl.h.

#define SIGNED_TYPE_MIN (   type)    (((type) -1) << (8*sizeof(type)-1))

Definition at line 172 of file gmp-impl.h.

#define SIZ (   x)    ((x)->_mp_size)

Definition at line 159 of file gmp-impl.h.

Definition at line 980 of file gmp-impl.h.

#define TARGET_REGISTER_STARVED   0

Definition at line 726 of file gmp-impl.h.

#define TMP_ALLOC (   size)    __gmp_tmp_alloc (((unsigned long) (size) + __TMP_ALIGN - 1) & -__TMP_ALIGN)

Definition at line 131 of file gmp-impl.h.

#define TMP_ALLOC_LIMBS (   n)    TMP_ALLOC_TYPE(n,mp_limb_t)

Definition at line 144 of file gmp-impl.h.

#define TMP_ALLOC_MP_PTRS (   n)    TMP_ALLOC_TYPE(n,mp_ptr)

Definition at line 145 of file gmp-impl.h.

#define TMP_ALLOC_TYPE (   n,
  type 
)    ((type *) TMP_ALLOC ((n) * sizeof (type)))

Definition at line 143 of file gmp-impl.h.

#define TMP_DECL (   marker)    tmp_marker marker

Definition at line 130 of file gmp-impl.h.

#define TMP_FREE (   marker)    __gmp_tmp_free (&marker)

Definition at line 134 of file gmp-impl.h.

#define TMP_MARK (   marker)    __gmp_tmp_mark (&marker)

Definition at line 133 of file gmp-impl.h.

#define TOOM3_MUL_THRESHOLD   256

Definition at line 486 of file gmp-impl.h.

Definition at line 494 of file gmp-impl.h.

#define udiv_qrnnd_preinv (   q,
  r,
  nh,
  nl,
  d,
  di 
)
Value:
do {                                                           \
    mp_limb_t _q, _ql, _r;                                     \
    mp_limb_t _xh, _xl;                                               \
    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)

Definition at line 752 of file gmp-impl.h.

#define udiv_qrnnd_preinv2gen (   q,
  r,
  nh,
  nl,
  d,
  di,
  dnorm,
  lgup 
)
Value:
do {                                                           \
    mp_limb_t _n2, _n10, _n1, _nadj, _q1;                      \
    mp_limb_t _xh, _xl;                                               \
    _n2 = ((nh) << (BITS_PER_MP_LIMB - (lgup))) + ((nl) >> 1 >> (l - 1));\
    _n10 = (nl) << (BITS_PER_MP_LIMB - (lgup));                       \
    _n1 = ((mp_limb_signed_t) _n10 >> (BITS_PER_MP_LIMB - 1));        \
    _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)

Definition at line 780 of file gmp-impl.h.

#define udiv_qrnnd_preinv2norm (   q,
  r,
  nh,
  nl,
  d,
  di 
)
Value:
do {                                                           \
    mp_limb_t _n2, _n10, _n1, _nadj, _q1;                      \
    mp_limb_t _xh, _xl;                                               \
    _n2 = (nh);                                                       \
    _n10 = (nl);                                               \
    _n1 = ((mp_limb_signed_t) _n10 >> (BITS_PER_MP_LIMB - 1));        \
    _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)

Definition at line 799 of file gmp-impl.h.

#define ULONG_HIGHBIT   UNSIGNED_TYPE_HIGHBIT (unsigned long)

Definition at line 184 of file gmp-impl.h.

#define ULONG_MAX   UNSIGNED_TYPE_MAX (unsigned long)

Definition at line 182 of file gmp-impl.h.

#define UNSIGNED_TYPE_HIGHBIT (   type)    ((type) ~ (UNSIGNED_TYPE_MAX(type) >> 1))

Definition at line 171 of file gmp-impl.h.

#define UNSIGNED_TYPE_MAX (   type)    ((type) ~ (type) 0)

Definition at line 170 of file gmp-impl.h.

#define USHORT_HIGHBIT   UNSIGNED_TYPE_HIGHBIT (unsigned short)

Definition at line 193 of file gmp-impl.h.

#define USHORT_MAX   UNSIGNED_TYPE_MAX (unsigned short)

Definition at line 191 of file gmp-impl.h.

#define VERSION   "3.1.1"

Definition at line 59 of file gmp-impl.h.

Definition at line 887 of file gmp-impl.h.


Typedef Documentation

typedef long int DItype

Definition at line 880 of file gmp-impl.h.

typedef long SItype

Definition at line 874 of file gmp-impl.h.

typedef struct tmp_marker

Definition at line 114 of file gmp-impl.h.

typedef unsigned long int UDItype

Definition at line 881 of file gmp-impl.h.

typedef unsigned int UHWtype

Definition at line 886 of file gmp-impl.h.

typedef unsigned char UQItype

Definition at line 873 of file gmp-impl.h.

typedef unsigned long USItype

Definition at line 875 of file gmp-impl.h.

typedef mp_limb_t UWtype

Definition at line 885 of file gmp-impl.h.


Function Documentation

Here is the caller graph for this function:

Here is the caller graph for this function:

void *_mp_default_allocate _PROTO ( (size_t)  )
void *_mp_default_reallocate _PROTO ( (void *, size_t, size_t)  )
void _mp_default_free _PROTO ( (void *, size_t)  )
static int __gmp_assert_fail _PROTO ( (const char *filename, int linenum, const char *expr)  ) [static]
double __gmp_scale2 _PROTO ( (double, int )
int __gmp_extract_double _PROTO ( (mp_ptr, double)  )

Variable Documentation

const unsigned char modlimb_invert_table[128]

Definition at line 5093 of file gmp.c.