A bug causing AMD 11h processors to be treated like AMD 10h has been fixed.
The 11h processors do not correctly handle all 10h (aka K10) instructions,
and GMP's use of these instructions results in major miscomputations (not
as one would have hoped CPU traps of some 'illegal instruction' sort).
A bug affecting recent Intel Sandy Bridge CPUs resulting in configuration
failures has been fixed.
A couple of tests added to the self-check suite.
Changes in GMP 5.0.4
Thresholds in mpn_powm_sec for both fat and non-fat builds are now
used safely, plugging a one-word buffer overrun introduced in the 5.0.3
release (for non-fat) and a multi-word buffer overrun that existed since
5.0 (for fat). (We have not been able to provoke malign stack smashing
in any of the ~100 configurations explored by the GMP nightly builds, but
the bug should be assumed to be exploitable.)
Two bugs in multiplication code causing incorrect computation with
extremely low probability have been fixed.
Two bugs in the gcd code have been fixed. They could lead to
incorrect results, but for uniformly distributed random operands, the
likelihood for that is infinitesimally small. (There was also a third
bug, but that was an incorrect ASSERT, which furthermore was not enabled
A bug affecting 32-bit PowerPC division has been fixed. The bug
caused miscomputation for certain divisors in the range 232 ... 264-1
(about 1 in 230 of these).
None, except indirectly through recognition of new CPUs, and through
better tuning parameters.
Some more tests added to the self-check suite.
The AMD "Bulldozer" CPU is now recognised.
Changes in GMP 5.0.3
A few minor bugs related to portability fixed.
A slight timing leak of the powm_sec functions have been sealed. (This
leak could possibly be used to extract the most significant few bits of the
exponent. "Few" here means at most 10.)
The mpz_nextprime function now runs a safer number of pseudo-random prime
A bug in division code possibly causing incorrect computation was fixed.
None, except indirectly through recognition of new CPUs, and through better
New CPUs recognised.
IBM S/390 are now supported in both 31/32-bit and 64-bit mode. (We have
not been able to fully test this on any multilib machine, since IBM expired
our guest account a few days before our release.)
Changes in GMP 5.0.2
Many minor bugs related to portability fixed.
The support for HPPA 2.0N now works, after an assembly bug fix.
A test case type error has been fixed. The symptom of this bug
was spurious 'make check' failures.
None, except indirectly through recognition of new CPUs.
Fat builds are now supported for 64-bit x86 processors also under Darwin.
Changes in GMP 5.0.1
Fat builds fixed.
Fixed crash for huge multiplies when old FFT_TABLE2 type of parameter
selection tables' sentinel was smaller than multiplied operands.
The solib numbers now reflect the removal of the documented but preliminary
mpn_bdivmod function; we correctly flag incompatibility with GMP 4.3.
GMP 5.0.0 has this wrong, and should perhaps be uninstalled to avoid
Multiplication of large numbers has indirectly been sped up through
better FFT tuning and processor recognition. Since many operations
depend on multiplication, there will be a general speedup.
More Core i3, i5 an Core i7 processor models are recognised.
Fixes and workarounds for Mac OS quirks should make this GMP version
build using many of the different versions of "Xcode".
The amount of scratch memory needed for multiplication of huge numbers
have been reduced substantially (but is still larger than in GMP 4.3.)
Likewise, the amount of scratch memory needed for division of large
numbers have been reduced substantially.
The FFT tuning code of tune/tuneup.c has been completely rewritten,
and new, large FFT parameter selection tables are provided for many
Upgraded to the latest autoconf, automake, libtool.
Changes in GMP 5.0.0
None (contains the same fixes as release 4.3.2).
Multiplication has been overhauled:
Multiplication of larger same size operands has been improved with
the addition of two new Toom functions and a new internal function
mpn_mulmod_bnm1 (computing U * V mod (Bn-1), B being the
word base. This latter function is used for the largest products,
waiting for a better Schoenhage-Strassen U * V mod (Bn+1)
Likewise for squaring.
Multiplication of different size operands has been improved with the
addition of many new Toom function, and by selecting underlying
functions better from the main multiply functions.
Division and mod have been overhauled:
Plain "schoolbook" division is reimplemented using faster quotient
Division Q = N/D, R = N mod D where both the quotient and remainder
are needed now runs in time O(M(log(N))). This is an improvement of
a factor log(log(N))
Division where just the quotient is needed is now O(M(log(Q))) on
Modulo operations using Montgomery REDC form now take time O(M(n)).
Exact division Q = N/D by means of mpz_divexact has been improved
for all sizes, and now runs in time O(M(log(N))).
The function mpz_powm is now faster for all sizes. Its complexity has
gone from O(M(n)log(n)m) to O(M(n)m) where n is the size of the modulo
argument and m is the size of the exponent. It is also radically
faster for even modulus, since it now partially factors such modulus
and performs two smaller modexp operations, then uses CRT.
The internal support for multiplication yielding just the lower n limbs
has been improved by using Mulders' algorithm.
Computation of inverses, both plain 1/N and 1/N mod Bn have been
improved by using well-tuned Newton iterations, and wrap-around
multiplication using mpn_mulmod_bnm1.
A new algorithm makes mpz_perfect_power_p asymptotically faster.
The function mpz_remove uses a much faster algorithm, is better tuned,
and also benefits from the division improvements.
Intel Atom and VIA Nano specific optimisations.
Plus hundreds of smaller improvements and tweaks!
New mpz function: mpz_powm_sec for side-channel quiet modexp
The function mpn_tdiv_qr now allows certain argument overlap.
Support for fat binaries for 64-bit x86 processors has been added.
A new type, mp_bitcnt_t for bignum bit counts, has been introduced.
Support for Windows64 through mingw64 has been added.
The cofactors of mpz_gcdext and mpn_gcdext are now more strictly
normalised, returning to how GMP 4.2 worked. (Note that also release
4.3.2 has this change.)
The mpn_mul function should no longer be used for squaring,
instead use the new mpn_sqr.
The algorithm selection has been improved, the number of thresholds have
more than doubled, and the tuning and use of existing thresholds have
The tune/speed program can measure many of new functions.
The mpn_bdivmod function has been removed. We do not consider this an
incompatible change, since the function was marked as preliminary.
The testsuite has been enhanced in various ways.
The GMP 5 release would not have been possible without the very devoted work
of Niels Möller and Marco Bodrato. As usual, Torbjörn Granlund coordinated the
development and release, and did a fair amount of development work himself.
Please see the GMP manual
for a complete list of GMP contributors.