This file lists projects suitable for volunteers. Please see the file tasks, or http://www.swox.com/gmp/tasks.html for smaller tasks.
If you want to work on any of the projects below, please let tege@swox.com know. If you want to help with a project that already somebody else is working on, please talk to that person too, tege@swox.com can put you in touch. (There are no email addresses of volunteers below, due to spamming problems.)
A C++ wrapper for GMP is highly desirable. Several people have started writing one, but nobody has so far finished it. For a wrapper to be useful, one needs to pay attention to efficiency.
a += b
by directly applying mpz_add.
The current multiplication code is 3-way Toom-Cook based and runs at O(n^1.465) when the operands are both around n digits large. Several new developments are desirable:
GMP's current division routines are O(n^2), or to be accurate, O(n(m-n)) where n is the digit count of the divisor, and m is the digit count of the dividend. Modular reduction code rely on division, and is thus also slow.
Desirable new developments:
mpz_powm
, mpz_powm_ui
, etc, use modular
multiplication for the operand ranges where that helps. Actually, these
functions should probably be implemented at the mpn level as part of
this development.
mpn_tdiv_q
, mpn_tdiv_r
,
mpn_tdiv_qr
) replacing mpn_divmod
and (the
slow!) mpn_divrem
.
Write new and tune existing assembly routines. The functions in mpn/tests are useful for testing and timing the routines you write. See the README file in that directory for instructions on how to use the various test files.
Please make sure your new routines are fast for these three situations:
The most important routines are mpn_addmul_1, mpn_mul_basecase and mpn_sqr_basecase. The latter two don't exist for all machines, while mpn_addmul_1 exists for almost all machines.
Standard techniques for these routines are unrolling, software pipelining, and specialization for common operand values. For machines with poor integer multiplication, it is often possible to improve the performance using floating-point operations, or SIMD operations such as MMX or Sun's VIS.
Using floating-point operations is interesting but somewhat tricky. Since IEEE double has 53 bit of mantissa, one has to split the operands in small prices, so that no result is greater than 2^53. For 32-bit computers, splitting one operand in 16-bit pieces works. For 64-bit machines, one operand can be split in 21-bit pieces and the other in 32-bit pieces. (A 64-bit operand can be split in just three 21-bit pieces if one allows the split operands to be negative!)
We want to recognize the processor very accurately, more accurately than other GNU packages. config.guess does not currently make the distinctions we would like it to do and a --target often needs to be set explicitly.
For example, "sparc" is not very useful as a machine architecture denotation. We want to distinguish old 32-bit SPARC without multiply support from newer 32-bit SPARC with such support. We want to recognize a SuperSPARC, since its implementation of the UDIV instruction is not complete, and will trap to the OS kernel for certain operands. And we want to recognize 64-bit capable SPARC processors as such. While the assembly routines can use 64-bit operations on all 64-bit SPARC processors, one can not use 64-bit limbs under all operating system. E.g., Solaris 2.5 and 2.6 doesn't preserve the upper 32 bits of most processor registers. For SPARC we therefore sometimes need to choose GMP configuration depending both on processor and operating system.
Other things autoconf should care about:
implver
and amask
assembly
instructions are better, but that doesn't differentiate between ev5 and
ev56.
shldl
).
In general, getting the exact right configuration, passing the exact right options to the compiler, etc, might mean that the GMP performance more than doubles.
When testing, make sure to test at least the following for all out target machines: (1) Both gcc and cc (and c89). (2) Both 32-bit mode and 64-bit mode (such as -n32 vs -64 under Irix). (3) Both the system `make' and GNU `make'. (4) With and without GNU binutils.
We'd ultimately like to build multiple variants of the library under certain systems. An example is -n32, -o32, and -64 on Irix.
Improve config.guess. It should say mips2, mips3, and mips4. It should say supersparc, microsparc, ultrasparc1, ultrasparc2. Etc. Likewise for HPPA. (Alpha and x86 work already. Ensure config.sub accepts the guesses.)
We currently have extended GCD based on Lehmer's method. But the binary method can quite easily be improved for bignums in a similar way Lehmer improved Euclid's algorithm. The result should beat Lehmer's method by about a factor of 2. Furthermore, the multiprecision step of Lehmer's method and the binary method will be identical, so the current code can mostly be reused. It should be possible to share code between GCD and GCDEXT, and probably with Jacobi symbols too.
Implement the functions of math.h for the GMP mpf layer! Check the paper "Pi and the AGM" for ideas how to do this. These functions are desirable: acos, acosh, asin, asinh, atan, atanh, atan2, cos, cosh, exp, log, log10, pow, sin, sinh, tan, tanh.
The current code for computing square roots use a Newton iteration that rely on division. It is possible to avoid using division by computing 1/sqrt(A) using this formula:
2 x = x (3 - A x )/2. i+1 i iThe final result is then computed without division using,
sqrt(A) = A x . nThe resulting code should be substantially faster than the current code.
Implement, at the mpn level, a routine for computing the nth root of a number. The routine should use Newton's method, preferably without using division.
If the routine becomes fast enough, perhaps square roots could be computed using this function.
Write random number routines that accept bit counts instead of limb counts. A state should be passed to each random number generator; no global state should be used, since that would be non-reentrant.
Partially done by Linus Nordberg. Ask for the current code.
Please send comments about this page to
tege@swox.com. Copyright (C) 1999, 2000 Torbjörn Granlund. |