summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2020-06-10 09:21:46 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2020-06-10 09:21:46 +0000
commit745f6f74d62335b031f6ddfb77b66a086a4428fc (patch)
tree8ec0ebf5f11865719fe5cd5cede5af3b57fcbd75
parent2d5846270ab2f1757ff9cd3494f6602b7a40b87b (diff)
downloadmpfr-745f6f74d62335b031f6ddfb77b66a086a4428fc.tar.gz
[doc/mini-gmp] Major update.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@13958 280ebfd0-de03-0410-8827-d642c229c3f4
-rw-r--r--doc/mini-gmp37
1 files changed, 18 insertions, 19 deletions
diff --git a/doc/mini-gmp b/doc/mini-gmp
index 085e77608..4a8d6a600 100644
--- a/doc/mini-gmp
+++ b/doc/mini-gmp
@@ -14,13 +14,19 @@ For "make check", tests that use features not supported by mini-gmp
Note: To use this version of the MPFR library, you need to define
the MPFR_USE_MINI_GMP macro before including mpfr.h (alternatively,
-you can modify mpfr.h to define this macro at the beginning). But
-this will currently not be usable since mini-gmp.h does not declare
-gmp_randstate_t (you need to modify either mini-gmp.h or mpfr.h).
+you can modify mpfr.h to define this macro at the beginning, though
+this is discouraged). And since mini-gmp currently does not provide
+random functions, you also need to define the gmp_randstate_t type
+with
-Remark: the random functions provided by MPFR configured with mini-gmp
-use the lrand48() function, thus one should avoid this configuration if one
-needs some really serious random functions.
+ typedef long int gmp_randstate_t[1];
+
+before including mpfr.h (or you may want to modify mini-gmp.h).
+
+Remark: The random functions provided by MPFR configured with mini-gmp
+use the POSIX lrand48() and srand48() functions (the platform needs to
+provide them), thus one should avoid mini-gmp if one needs some really
+serious random functions.
This was tested with MPFR svn r13226 and GMP 6.1.2 on x86_64 GNU/Linux:
============================================================================
@@ -39,18 +45,11 @@ How to use mini-gmp with reduced limb size
==========================================
Following the idea of Micro-GMP [1], the GMP developers have adapted mini-gmp
-so that it can be used with a reduced limb size.
-
-For that, you have to take a GMP snapshot from December 09, 2018, or later
-(see https://gmplib.org/download/snapshot/).
-
-Then replace the "typedef unsigned long mp_limb_t;" line of mini-gmp.h
-to have for example:
-
- #include <stdint.h>
- typedef uint8_t mp_limb_t;
- #define __GMP_SHORT_LIMB
-
-Then you can configure MPFR with that version of mini-gmp, as indicated above.
+so that it can be used with a reduced limb size. For that, you need GMP 6.2.0
+(or later) and define the MINI_GMP_LIMB_TYPE macro with the associated base
+type, e.g.
+ -DMINI_GMP_LIMB_TYPE=char (in practice, 8 bits)
+ -DMINI_GMP_LIMB_TYPE=short (in practice, 16 bits)
+ -DMINI_GMP_LIMB_TYPE=int (in practice, 32 bits)
[1] https://members.loria.fr/PZimmermann/talks/microgmp.pdf