gnu MP in libgcj
Per Bothner
per@bothner.com
Mon Oct 9 17:44:00 GMT 2000
Bryce McKinlay <bryce@albatross.co.nz> writes:
> The libgcj tree contains a copy of a (rather old) version of the gmp
> library. My understanding is that this was once going to be used to
> support the java.math.BigDecimal/BigInteger implementations, but became
> unneccessary when we got a pure-Java implementation.
Well, gmp is not *needed* with the current pure-Java implementation.
However, the pure-Java implementation was designed so that you
could relatively easily replace the pure-Java gnu.gcj.math.MPN
with a version based on the mpn routines from gmp. As long
as gmp uses "limbs" that much the representation of Java 'int'
(which should be teh case on most 32-bit systems), then it should
be quite trivial to plug in the gmp sroutines. Since these
routines are well tuned, and on many platform assembler, that
could yield a substantial speed-up - without incresing code size.
Two problems, though:
(1) The gmp license is more strict than the libgcj license.
Therefore, we cannot make gmp the default (unless the license
is changed), but should make it a configuration option.
(2) If gmp uses 64-bit limbs (which it does on some platforms),
using gmp will be much more difficult.
--
--Per Bothner
per@bothner.com http://www.bothner.com/~per/
More information about the Java
mailing list