precompiled GMP
delta trinity
deltatrinity@hotmail.com
Tue, 13 May 2003 14:53:28 -0400
>From: Andreas Fabri <Andreas.Fabri@geometryfactory.com>
>To: gmp-discuss@swox.com
>Subject: precompiled GMP Date: Tue, 13 May 2003 12:50:21 +0200
>
>Hello,
>
>I work in a project where we want to ship precompiled GMP for the Windows
>platform.
>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
>project
>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
>gmp.lib
>I mean a version that I compile with gcc (of mingw) and that links with
>cl.exe.
>
>
>
>Finally, I am wondering, if precompiling is a good idea at all. Obviously
>it
>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
>implementations
>of arithmetic operations, because if I precompile with the assembler
>routines
>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,
>
>Andreas
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 McAfee.com VirusScan Online
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963