Added some notes about gmp.h and a devel directory to the doc directory.

This commit is contained in:
wbhart 2008-04-18 03:34:51 +00:00
parent ed93f3a175
commit bff17c52a3

37
doc/devel/gmp-h.txt Normal file
View File

@ -0,0 +1,37 @@
Some compilers with hacks:
====================================
- GNUC
- DEC C
- SCO OpenUNIX 8 cc
- __cplusplus
Useful/undocumented macros in gmp.h:
====================================
__GMPN_ABS(x) - absolute value
__GMPN_MAX(h, i) - max of h and i
__GMPN_UINT_MAX - (int) ~0
__GMPN_ULONG_MAX - (unsigned long) ~0
__GMPN_USHRT_MAX - unsigned short) ~0
__GMPN_LIKELY(cond) - branch likely hint
__GMPN_UNLIKELY(cond) - branch unlikely hint
- e.g. if UNLIKELY(c >= 0L)....
Note: the __GMPN_ macros are redefined with nicer names in gmp-impl.h
mp_bits_per_limb - number of bits per limb
gmp_version - GMP version number i.j or i.j.k as a null terminated string
gmp_errno - integer corresponding to a GMP error condition:
0 none
1 unsupported argument
2 division by zero
4 sqrt of negative
8 invalid argument
Undocumented mpn functions prototyped in gmp.h:
===============================================
mp_limb_t mpn_preinv_mod_1(mp_srcptr sp, mp_size_t sn, mp_limb_t x, mp_limb_t xinv) -
compute {sp, sn} mod x given a precomputed inverse xinv of x