precompiled GMP

DTAshley@aol.com DTAshley@aol.com
Tue, 13 May 2003 07:09:01 EDT


--part1_198.1a300b58.2bf22c4d_boundary
Content-Type: text/plain; charset="US-ASCII"
Content-Transfer-Encoding: 7bit

In a message dated 5/13/2003 6:52:16 AM Eastern Daylight Time, 
Andreas.Fabri@geometryfactory.com writes:

> 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?

The "generic" implementation uses straight portable 'C' and no 
assembly-language.  I would expect it is AT LEAST 3-5 times slower than the 
A/L.  For example, checking rollover on add using a comparison like

new_result = result + a;
if (new_result < result)
...

will probably use at least twice as many instructions as the traditional 
ADD/ADC implementation.  Most things useful in extended-precision fixed-point 
arithmetic can't be specified nicely in 'C'.

You want to avoid the "generic".

Dave.

--part1_198.1a300b58.2bf22c4d_boundary
Content-Type: text/html; charset="US-ASCII"
Content-Transfer-Encoding: quoted-printable

<HTML><FONT FACE=3Darial,helvetica><FONT  SIZE=3D2 FAMILY=3D"SANSSERIF" FACE=
=3D"Arial" LANG=3D"0">In a message dated 5/13/2003 6:52:16 AM Eastern Daylig=
ht Time, Andreas.Fabri@geometryfactory.com writes:<BR>
<BR>
<BLOCKQUOTE TYPE=3DCITE style=3D"BORDER-LEFT: #0000ff 2px solid; MARGIN-LEFT=
: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px">But, do I have to use the gener=
ic implementations<BR>
of arithmetic operations, because if I precompile with the assembler routine=
s<BR>
in mpn/x86/P6 it will not run on a k7&nbsp; hardware and the other way round=
.<BR>
How much slower is the generic implementation?</BLOCKQUOTE></FONT><FONT  COL=
OR=3D"#000000" style=3D"BACKGROUND-COLOR: #ffffff" SIZE=3D2 FAMILY=3D"SANSSE=
RIF" FACE=3D"Arial" LANG=3D"0"><BR>
</FONT><FONT  COLOR=3D"#000000" style=3D"BACKGROUND-COLOR: #ffffff" SIZE=3D2=
 FAMILY=3D"SANSSERIF" FACE=3D"Arial" LANG=3D"0"><BR>
</FONT><FONT  COLOR=3D"#000000" style=3D"BACKGROUND-COLOR: #ffffff" SIZE=3D2=
 FAMILY=3D"SANSSERIF" FACE=3D"Arial" LANG=3D"0">The "generic" implementation=
 uses straight portable 'C' and no assembly-language.&nbsp; I would expect i=
t is AT LEAST 3-5 times slower than the A/L.&nbsp; For example, checking rol=
lover on add using a comparison like<BR>
<BR>
new_result =3D result + a;<BR>
if (new_result &lt; result)<BR>
...<BR>
<BR>
will probably use at least twice as many instructions as the traditional ADD=
/ADC implementation.&nbsp; Most things useful in extended-precision fixed-po=
int arithmetic can't be specified nicely in 'C'.<BR>
<BR>
You want to avoid the "generic".<BR>
<BR>
Dave.</FONT></HTML>

--part1_198.1a300b58.2bf22c4d_boundary--