Givaro
Macros | Functions | Variables
reclonglong.h File Reference
+ This graph shows which files directly or indirectly include this file:

Macros

#define __BITS4   (W_TYPE_SIZE / 4)
 
#define __ll_B   ((UWtype) 1 << (W_TYPE_SIZE / 2))
 
#define __ll_lowpart(t)   ((UWtype) (t) & (__ll_B - 1))
 
#define __ll_highpart(t)   ((UWtype) (t) >> (W_TYPE_SIZE / 2))
 
#define __MPN(x)   __##x
 
#define recint_count_leading_zeros_gcc_clz(count, x)
 
#define recint_count_trailing_zeros_gcc_ctz(count, x)
 
#define __umulsidi3(u, v)
 
#define mpn_recint_umul_ppmm   __MPN(recint_umul_ppmm)
 
#define mpn_recint_umul_ppmm_r   __MPN(recint_umul_ppmm_r)
 
#define mpn_recint_udiv_qrnnd   __MPN(recint_udiv_qrnnd)
 
#define mpn_recint_udiv_qrnnd_r   __MPN(recint_udiv_qrnnd_r)
 
#define recint_add_ssaaaa(sh, sl, ah, al, bh, bl)
 
#define recint_sub_ddmmss(sh, sl, ah, al, bh, bl)
 
#define recint_umul_ppmm(w1, w0, u, v)
 
#define recint_smul_ppmm(w1, w0, u, v)
 
#define __recint_udiv_qrnnd_c(q, r, n1, n0, d)
 
#define UDIV_NEEDS_NORMALIZATION   1
 
#define recint_udiv_qrnnd   __recint_udiv_qrnnd_c
 
#define recint_count_leading_zeros(count, x)
 
#define RECINT_COUNT_LEADING_ZEROS_0   (W_TYPE_SIZE - 1)
 
#define RECINT_COUNT_LEADING_ZEROS_NEED_CLZ_TAB
 
#define RECINT_COUNT_LEADING_ZEROS_SLOW
 
#define recint_count_trailing_zeros(count, x)
 
#define UDIV_PREINV_ALWAYS   0
 
#define UMUL_TIME   1
 
#define UDIV_TIME   UMUL_TIME
 

Functions

UWtype __recint_umul_ppmm (UWtype *, UWtype, UWtype)
 
UWtype __recint_umul_ppmm_r (UWtype, UWtype, UWtype *)
 
UWtype __recint_udiv_qrnnd (UWtype *, UWtype, UWtype, UWtype)
 
UWtype __recint_udiv_qrnnd_r (UWtype, UWtype, UWtype, UWtype *)
 

Variables

const unsigned char __clz_tab [129]
 

Macro Definition Documentation

◆ __BITS4

#define __BITS4   (W_TYPE_SIZE / 4)

◆ __ll_B

#define __ll_B   ((UWtype) 1 << (W_TYPE_SIZE / 2))

◆ __ll_lowpart

#define __ll_lowpart (   t)    ((UWtype) (t) & (__ll_B - 1))

◆ __ll_highpart

#define __ll_highpart (   t)    ((UWtype) (t) >> (W_TYPE_SIZE / 2))

◆ __MPN

#define __MPN (   x)    __##x

◆ recint_count_leading_zeros_gcc_clz

#define recint_count_leading_zeros_gcc_clz (   count,
 
)
Value:
do { \
(count) = __builtin_clzl (x); \
} while (0)

◆ recint_count_trailing_zeros_gcc_ctz

#define recint_count_trailing_zeros_gcc_ctz (   count,
 
)
Value:
do { \
(count) = __builtin_ctzl (x); \
} while (0)

◆ __umulsidi3

#define __umulsidi3 (   u,
 
)
Value:
({UWtype __hi, __lo; \
recint_umul_ppmm (__hi, __lo, u, v); \
((UDWtype) __hi << W_TYPE_SIZE) | __lo; })
uint64_t UWtype
Definition: recdefine.h:127
uint64_t UDWtype
Definition: recdefine.h:129
#define W_TYPE_SIZE
Definition: recdefine.h:144

◆ mpn_recint_umul_ppmm

#define mpn_recint_umul_ppmm   __MPN(recint_umul_ppmm)

◆ mpn_recint_umul_ppmm_r

#define mpn_recint_umul_ppmm_r   __MPN(recint_umul_ppmm_r)

◆ mpn_recint_udiv_qrnnd

#define mpn_recint_udiv_qrnnd   __MPN(recint_udiv_qrnnd)

◆ mpn_recint_udiv_qrnnd_r

#define mpn_recint_udiv_qrnnd_r   __MPN(recint_udiv_qrnnd_r)

◆ recint_add_ssaaaa

#define recint_add_ssaaaa (   sh,
  sl,
  ah,
  al,
  bh,
  bl 
)
Value:
do { \
UWtype __x; \
__x = (al) + (bl); \
(sh) = (ah) + (bh) + (__x < (al)); \
(sl) = __x; \
} while (0)

◆ recint_sub_ddmmss

#define recint_sub_ddmmss (   sh,
  sl,
  ah,
  al,
  bh,
  bl 
)
Value:
do { \
UWtype __x; \
__x = (al) - (bl); \
(sh) = (ah) - (bh) - ((al) < (bl)); \
(sl) = __x; \
} while (0)

◆ recint_umul_ppmm

#define recint_umul_ppmm (   w1,
  w0,
  u,
 
)
Value:
do { \
UWtype __x0, __x1, __x2, __x3; \
UHWtype __ul, __vl, __uh, __vh; \
UWtype __u = (u), __v = (v); \
\
__ul = __ll_lowpart (__u); \
__uh = __ll_highpart (__u); \
__vl = __ll_lowpart (__v); \
__vh = __ll_highpart (__v); \
\
__x0 = (UWtype) __ul * __vl; \
__x1 = (UWtype) __ul * __vh; \
__x2 = (UWtype) __uh * __vl; \
__x3 = (UWtype) __uh * __vh; \
\
__x1 += __ll_highpart (__x0);/* this can't give carry */ \
__x1 += __x2; /* but this indeed can */ \
if (__x1 < __x2) /* did we get it? */ \
__x3 += __ll_B; /* yes, add it in the proper pos. */ \
\
(w1) = __x3 + __ll_highpart (__x1); \
(w0) = (__x1 << W_TYPE_SIZE/2) + __ll_lowpart (__x0); \
} while (0)
#define __ll_B
Definition: reclonglong.h:46
#define __ll_lowpart(t)
Definition: reclonglong.h:47
#define __ll_highpart(t)
Definition: reclonglong.h:48

◆ recint_smul_ppmm

#define recint_smul_ppmm (   w1,
  w0,
  u,
 
)
Value:
do { \
UWtype __w1; \
UWtype __xm0 = (u), __xm1 = (v); \
recint_umul_ppmm (__w1, w0, __xm0, __xm1); \
(w1) = __w1 - (-(__xm0 >> (W_TYPE_SIZE - 1)) & __xm1) \
- (-(__xm1 >> (W_TYPE_SIZE - 1)) & __xm0); \
} while (0)

◆ __recint_udiv_qrnnd_c

#define __recint_udiv_qrnnd_c (   q,
  r,
  n1,
  n0,
 
)

◆ UDIV_NEEDS_NORMALIZATION

#define UDIV_NEEDS_NORMALIZATION   1

◆ recint_udiv_qrnnd

#define recint_udiv_qrnnd   __recint_udiv_qrnnd_c

◆ recint_count_leading_zeros

#define recint_count_leading_zeros (   count,
 
)
Value:
do { \
UWtype __xr = (x); \
UWtype __a; \
if (W_TYPE_SIZE == 32) \
{ \
__a = __xr < ((UWtype) 1 << 2*__BITS4) \
? (__xr < ((UWtype) 1 << __BITS4) ? 1 : __BITS4 + 1) \
: (__xr < ((UWtype) 1 << 3*__BITS4) ? 2*__BITS4 + 1 \
: 3*__BITS4 + 1); \
} \
else \
{ \
for (__a = W_TYPE_SIZE - 8; __a > 0; __a -= 8) \
if (((__xr >> __a) & 0xff) != 0) \
break; \
++__a; \
} \
\
(count) = W_TYPE_SIZE + 1 - __a - __clz_tab[__xr >> __a]; \
} while (0)
if(r||a.Value >=a.p) sub(a.Value
const unsigned char __clz_tab[129]
#define __BITS4
Definition: reclonglong.h:45

◆ RECINT_COUNT_LEADING_ZEROS_0

#define RECINT_COUNT_LEADING_ZEROS_0   (W_TYPE_SIZE - 1)

◆ RECINT_COUNT_LEADING_ZEROS_NEED_CLZ_TAB

#define RECINT_COUNT_LEADING_ZEROS_NEED_CLZ_TAB

◆ RECINT_COUNT_LEADING_ZEROS_SLOW

#define RECINT_COUNT_LEADING_ZEROS_SLOW

◆ recint_count_trailing_zeros

#define recint_count_trailing_zeros (   count,
 
)
Value:
do { \
UWtype __ctz_x = (x); \
int __ctz_c; \
if (LIKELY ((__ctz_x & 0xff) != 0)) \
(count) = __clz_tab[__ctz_x & -__ctz_x] - 2; \
else \
{ \
for (__ctz_c = 8 - 2; __ctz_c < W_TYPE_SIZE - 2; __ctz_c += 8) \
{ \
__ctz_x >>= 8; \
if (LIKELY ((__ctz_x & 0xff) != 0)) \
break; \
} \
\
(count) = __ctz_c + __clz_tab[__ctz_x & -__ctz_x]; \
} \
} while (0)

◆ UDIV_PREINV_ALWAYS

#define UDIV_PREINV_ALWAYS   0

◆ UMUL_TIME

#define UMUL_TIME   1

◆ UDIV_TIME

#define UDIV_TIME   UMUL_TIME

Function Documentation

◆ __recint_umul_ppmm()

UWtype __recint_umul_ppmm ( UWtype *  ,
UWtype  ,
UWtype   
)

◆ __recint_umul_ppmm_r()

UWtype __recint_umul_ppmm_r ( UWtype  ,
UWtype  ,
UWtype *   
)

◆ __recint_udiv_qrnnd()

UWtype __recint_udiv_qrnnd ( UWtype *  ,
UWtype  ,
UWtype  ,
UWtype   
)

◆ __recint_udiv_qrnnd_r()

UWtype __recint_udiv_qrnnd_r ( UWtype  ,
UWtype  ,
UWtype  ,
UWtype *   
)

Variable Documentation

◆ __clz_tab

const unsigned char __clz_tab[129]
extern