precompiled GMP

delta trinity
Tue, 13 May 2003 14:53:28 -0400

>From: Andreas Fabri <>
>Subject: precompiled GMP Date: Tue, 13 May 2003 12:50:21 +0200
>I work in a project where we want to ship precompiled GMP for the Windows 
>I succesfully followed the "Notes for Particular Systems" in the manual, 
>and I am
>wondering  what is the advantage/disadvantage if one follows Brian 
>Gladman's approach.
>An obvious disadvantage is his porting of assember. Whenever the GMP 
>makes a new release Brian's code has to be upgraded if necessary.
>Another question:
>The "Notes for Particular Systems" do not explain how to obtain a static 
>I mean a version that I compile with gcc (of mingw) and that links with 
>Finally, I am wondering, if precompiling is a good idea at all. Obviously 
>is nice for the user not to first install cygwin or mingw, and not to spend
>15 minutes on the installation.   But, do I have to use the generic 
>of arithmetic operations, because if I precompile with the assembler 
>in mpn/x86/P6 it will not run on a k7  hardware and the other way round.
>How much slower is the generic implementation?
>Thanks in advance,

Well, I don't know much about static libraries but if you're using Windows, 
you could build the shared libraries for different implementations.  For 
example, you could build Pentium, P2, P3, K7, ... dlls and put them in 
separate directory.  At runtime, you could detect the processor and load the 
appropriate library.

For your last question, I don't have specific numbers but for sure, the 
generic implementation is much slower than the assembly-optimized, even when 
comparing generic vs i486-optimized library.  Can be 10 to 100 times faster 
depending on which functions, especially when the assembly-optimized parts 
are called often in a tight loop, as for modular exponentiation or square 
roots for example.

Protect your PC - get VirusScan Online