Back to index

glibc  2.9
Classes | Defines | Typedefs | Functions | Variables
gmp-impl.h File Reference
#include "stack-alloc.h"
#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  bases
union  ieee_double_extract
struct  ieee_double_extract.s

Defines

#define NULL   ((void *) 0)
#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 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 const   /* Empty */
#define signed   /* Empty */
#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 MPZ_TMP_INIT(X, NLIMBS)
#define MPN_MUL_N_RECURSE(prodp, up, vp, size, tspace)
#define MPN_SQR_N_RECURSE(prodp, up, size, tspace)
#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 W_TYPE_SIZE   BITS_PER_MP_LIMB
#define impn_mul_n_basecase   __MPN(impn_mul_n_basecase)
#define impn_mul_n   __MPN(impn_mul_n)
#define impn_sqr_n_basecase   __MPN(impn_sqr_n_basecase)
#define impn_sqr_n   __MPN(impn_sqr_n)
#define _PROTO(x)   ()
#define IEEE_DOUBLE_BIG_ENDIAN   1
#define IEEE_DOUBLE_MIXED_ENDIAN   0

Typedefs

typedef unsigned char UQItype
typedef long SItype
typedef unsigned long USItype
typedef mp_limb_t UWtype
typedef unsigned int UHWtype

Functions

void * malloc ()
void * realloc ()
void free ()
void * _mp_default_allocate ()
void * _mp_default_reallocate ()
void _mp_default_free ()
void impn_mul_n_basecase _PROTO ((mp_ptr prodp, mp_srcptr up, mp_srcptr vp, mp_size_t size))
void impn_mul_n _PROTO ((mp_ptr prodp, mp_srcptr up, mp_srcptr vp, mp_size_t size, mp_ptr tspace))
void impn_sqr_n_basecase _PROTO ((mp_ptr prodp, mp_srcptr up, mp_size_t size))
void impn_sqr_n _PROTO ((mp_ptr prodp, mp_srcptr up, mp_size_t size, mp_ptr tspace))

Variables

void *(* _mp_allocate_func )()
void *(* _mp_reallocate_func )()
void(* _mp_free_func )()
mp_size_t __gmp_default_fp_limb_precision

Class Documentation

struct bases

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

Class Members
mp_limb_t big_base
mp_limb_t big_base_inverted
float chars_per_bit_exactly
int chars_per_limb
union ieee_double_extract

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

Class Members
double d
struct ieee_double_extract s
struct ieee_double_extract.s

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

Class Members
unsigned int exp:11
unsigned int manh:20
unsigned int manl:32
unsigned int sig:1

Define Documentation

#define _PROTO (   x)    ()

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

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

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

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

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

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

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

#define const   /* Empty */

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

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

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

#define IEEE_DOUBLE_BIG_ENDIAN   1

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

#define IEEE_DOUBLE_MIXED_ENDIAN   0

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

#define impn_mul_n   __MPN(impn_mul_n)

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

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

#define impn_sqr_n   __MPN(impn_sqr_n)

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

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

#define inline   /* Empty */

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

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

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

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

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

#define MPN_COPY   MPN_COPY_INCR

Definition at line 131 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 125 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 119 of file gmp-impl.h.

#define MPN_MUL_N_RECURSE (   prodp,
  up,
  vp,
  size,
  tspace 
)
Value:
do {                                                           \
    if ((size) < KARATSUBA_THRESHOLD)                                 \
      impn_mul_n_basecase (prodp, up, vp, size);               \
    else								\
      impn_mul_n (prodp, up, vp, size, tspace);                \
  } while (0);

Definition at line 172 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 141 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 150 of file gmp-impl.h.

#define MPN_SQR_N_RECURSE (   prodp,
  up,
  size,
  tspace 
)
Value:
do {                                                           \
    if ((size) < KARATSUBA_THRESHOLD)                                 \
      impn_sqr_n_basecase (prodp, up, size);                          \
    else								\
      impn_sqr_n (prodp, up, size, tspace);                           \
  } while (0);

Definition at line 179 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 134 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 165 of file gmp-impl.h.

#define NULL   ((void *) 0)

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

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

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

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

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

#define signed   /* Empty */

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

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

Definition at line 77 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 218 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 246 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 265 of file gmp-impl.h.

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


Typedef Documentation

typedef long SItype

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

typedef unsigned int UHWtype

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

typedef unsigned char UQItype

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

typedef unsigned long USItype

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

typedef mp_limb_t UWtype

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


Function Documentation

void _mp_default_free ( )
void impn_mul_n _PROTO ( (mp_ptr prodp, mp_srcptr up, mp_srcptr vp, mp_size_t size, mp_ptr tspace)  )
void impn_sqr_n _PROTO ( (mp_ptr prodp, mp_srcptr up, mp_size_t size, mp_ptr tspace)  )
void free ( )
void* malloc ( )
void* realloc ( )

Variable Documentation

void*(* _mp_allocate_func)()
void(* _mp_free_func)()
void*(* _mp_reallocate_func)()