From 348cdb775fe16e8aa3b18f026ec4ef28967955a0 Mon Sep 17 00:00:00 2001 From: Brian Gladman Date: Sat, 29 Sep 2018 13:26:59 +0100 Subject: [PATCH] update documentation for new windows build plus function additions --- doc/mpir.texi | 75 ++++++++++++++++++++++++++++++++++----------------- 1 file changed, 50 insertions(+), 25 deletions(-) diff --git a/doc/mpir.texi b/doc/mpir.texi index ea0ab3df..c34a6fee 100644 --- a/doc/mpir.texi +++ b/doc/mpir.texi @@ -1367,9 +1367,9 @@ preprocessor symbols and chooses the correct actual @file{mpir.h}. @cindex Visual Studio MPIR can be built with the professional and higher versions of Visual Studio -2012, 2013, 2015 and 2017. It can also be built with the community editions -of Visual Studio 2015 and 2017. If the assembler optimised versions of MPIR -are required, then both Python 3 and the YASM assembler also need to be +2013, 2015 and 2017. It can also be built with the community editions of +Visual Studio 2015 and 2017. If the assembler optimised versions of MPIR +are required, then Python 3 and the YASM assembler also need to be installed. MPIR can also be built with the Intel C/C++ compiler that can be integrated into versions of Visual Studio. @@ -1399,10 +1399,9 @@ A build of MPIR is started by double clicking on the file @file{mpir.sln} in the appropriate sub-directory within the MPIR root directory: @example - Visual Studio 2012: mpir/build.vc11/mpir.sln - Visual Studio 2013: mpir/build.vc12/mpir.sln - Visual Studio 2015: mpir/build.vc14/mpir.sln - Visual Studio 2017: mpir/build.vc15/mpir.sln + Visual Studio 2013: mpir/msvc/vs13/mpir.sln + Visual Studio 2015: mpir/msvc/vs15/mpir.sln + Visual Studio 2017: mpir/msvc/vs17/mpir.sln @end example Visual Studio will then display a list of individual build projects @@ -1411,9 +1410,9 @@ a typical list of projects is: @example dll_mpir_gc standard DLL, no assembler (win32 and x64) - dll_mpir_p3 assembly optimised DLL for pentium 3 (win32) - lib_mpir_p3 assembly optimised static library for - pentium 3 (x64) + dll_mpir_p6 assembly optimised DLL for pentium 6 (win32) + lib_mpir_p6 assembly optimised static library for + pentium 6 (win32) lib_mpir_core2 assembly optimised static library for core2 (x64) dll_mpir_core2 assembly optimised DLL for core2 (x64) @@ -1445,21 +1444,23 @@ depending on whether static library or DLL versions have been built. The Visual Studio builds for MPIR are initially provided with a small set of assembler optimised projects but many more are available and can be -obtained by running the Python program @command{mpir_config.py } that is -in the mpir\build-vc directory. The value of required depends on the +obtained by running the Python program @command{mpir_config.py []} +that is in the mpir\msvc directory. The value of required depends on the version of Visual Studio in use as follows: @example - Visual Studio 2012: 11 - Visual Studio 2013: 12 - Visual Studio 2015: 14 - Visual Studio 2017: 15 + Visual Studio 2013: 13 + Visual Studio 2015: 15 + Visual Studio 2017: 17 @end example -This program, which has to be run before Visual Studio, provides a list of -all the assembler optimised versions of MPIR that are available. Any number -of versions can be chosen and these builds will then be available when Visual -Studio is subsequently opened by double clicking on @file{mpir.sln}. +The parameter is optional and is the version number of the Windows SDK +for which the builds will be taargetted (e.g. 10.0.16299.0). This program, +which has to be run before Visual Studio, provides a list of all the assembler +optimised versions of MPIR that are available. Any number of versions can be +chosen and these builds will then be available when Visual Studio is subsequently +opened by double clicking on @file{mpir.sln}. It is advisable not to have Visual +Studio running when new builds are being added in this way. @item Testing Visual Studio versions of MPIR @@ -1467,10 +1468,9 @@ Testing a version of the library once it has been built is started by double clicking on the appropriate solution file: @example - Visual Studio 2012: mpir/build.vc11/mpir-tests.sln - Visual Studio 2013: mpir/build.vc12/mpir-tests.sln - Visual Studio 2015: mpir/build.vc14/mpir-tests.sln - Visual Studio 2017: mpir/build.vc15/mpir-tests.sln + Visual Studio 2013: mpir/msvc/vs13/mpir-tests.sln + Visual Studio 2015: mpir/msvc/vs15/mpir-tests.sln + Visual Studio 2017: mpir/msvc/vs17/mpir-tests.sln @end example The tests are always run on the last version of MPIR built and it is important @@ -1494,7 +1494,7 @@ executing the Python program @command{run-tests.py} in the appropriate Visual Studio build sub-directory, for example, for Visual Studio 2017: @example - mpir/build.vc15/mpir-tests/run-tests.py + mpir/msvc/vs17/mpir-tests/run-tests.py @end example @end table @@ -3054,6 +3054,16 @@ This is similar to the standard C @code{frexp} function (@pxref{Normalization Functions,,, libc, The GNU C Library Reference Manual}). @end deftypefun +@deftypefun mpir_si mpz_get_2exp_d (double *@var{???}, mpz_t @var{op}) +Convert @var{op} to a @code{double}, truncating if necessary (ie.@: rounding +towards zero), and returning the exponent separately. + +This function has been added on Windows as an alternative to mpz_get_d_2exp +to avoid problems that occur on 64-bit Windows systems where pointers to +integers point to 32-bit integer variables when MPIR expects to find space +for 64-bit integers. +@end deftypefun + @deftypefun {char *} mpz_get_str (char *@var{str}, int @var{base}, mpz_t @var{op}) Convert @var{op} to a string of digits in base @var{base}. The base may vary from 2 to 36 or from @minus{}2 to @minus{}36. @@ -4752,6 +4762,16 @@ This is similar to the standard C @code{frexp} function (@pxref{Normalization Functions,,, libc, The GNU C Library Reference Manual}). @end deftypefun +@deftypefun mpir_si mpf_get_2exp_d (double *@var{rop}, mpf_t @var{op}) +Convert @var{op} to a @code{double}, truncating if necessary (ie.@: rounding +towards zero), and with an exponent returned separately. + +This function has been added on Windows as an alternative to mpf_get_d_2exp +to avoid problems that occur on 64-bit Windows systems where pointers to +integers point to 32-bit integer variables when MPIR expects to find space +for 64-bit integers. +@end deftypefun + @deftypefun mpir_si mpf_get_si (mpf_t @var{op}) @deftypefunx mpir_ui mpf_get_ui (mpf_t @var{op}) Convert @var{op} to a @code{mpir_si} or @code{mpir_ui}, truncating any @@ -4869,6 +4889,7 @@ Set @var{rop} to @m{@var{op1}/2^{op2}, @var{op1} divided by 2 raised to @cindex Comparison functions @deftypefun int mpf_cmp (mpf_t @var{op1}, mpf_t @var{op2}) +@deftypefunx int mpf_cmp_z (const mpf_t @var{op1}, const mpz_t @var{op2}) @deftypefunx int mpf_cmp_d (mpf_t @var{op1}, double @var{op2}) @deftypefunx int mpf_cmp_ui (mpf_t @var{op1}, mpir_ui @var{op2}) @deftypefunx int mpf_cmp_si (mpf_t @var{op1}, mpir_si @var{op2}) @@ -5336,6 +5357,10 @@ positive value if @math{@var{s1} > @var{s2}}, 0 if they are equal, or a negative value if @math{@var{s1} < @var{s2}}. @end deftypefun +@deftypefun int mpn_zero_p (const mp_limb_t *@var{sp}, mp_size_t @var{n}) +Test @{@var{sp}, @var{n}@} and return 1 if the operand is zero, 0 otherwise. +@end deftypefun + @deftypefun mp_size_t mpn_gcd (mp_limb_t *@var{rp}, mp_limb_t *@var{s1p}, mp_size_t @var{s1n}, mp_limb_t *@var{s2p}, mp_size_t @var{s2n}) Set @{@var{rp}, @var{retval}@} to the greatest common divisor of @{@var{s1p}, @var{s1n}@} and @{@var{s2p}, @var{s2n}@}. The result can be up to @var{s2n}