T3/T3 mul_2 and addmul_2

David Miller davem at davemloft.net
Fri Mar 22 17:42:25 CET 2013


From: Torbjorn Granlund <tg at gmplib.org>
Date: Fri, 08 Mar 2013 21:23:55 +0100

> David Miller <davem at davemloft.net> writes:
> 
>   Seems to work fine, here are some speed runs:
>   
>   davem at patience:~/src/GMP/HG/build-sparc64-ultrasparct4/tune$ ./speed -C -s 32-64 -t 2 mpn_mul_2
>   overhead 6.06 cycles, precision 10000 units of 3.51e-10 secs, CPU freq 2847.34 MHz
>               mpn_mul_2
>   32             7.7564
>   34             7.5137
>   36             7.7395
>   38             7.4933
>   40             7.7088
>   42             7.4566
>   44             7.7251
>   46             7.4409
>   48             7.6494
>   50             7.4467
>   52             7.6216
>   54             7.4067
>   56             7.5927
>   58             7.3858
>   60             7.6043
>   62             7.4039
>   64             7.5909
 ...
> If you want to play with this, please start with the checked in code
> (you'll need to fresh configure.ac to allow the aormul_2 'multifunc'
> name).  The first thing to try is its speed compared to the code you
> timed above.

I'm getting wildly different performance characteristics for the code
you checked in, for example for mpn_mul_2 the current GMP tree gives:

davem at patience:~/src/GMP/HG/build-sparc64-ultrasparct4/tune$ ./speed -C -s 32-64 -t 2 mpn_mul_2
overhead 6.06 cycles, precision 10000 units of 3.51e-10 secs, CPU freq 2847.28 MHz
            mpn_mul_2
32             8.5705
34             7.6267
36             8.5262
38             7.5665
40             8.5000
42             7.5605
44             8.4694
46             7.5275
48             8.4615
50             7.5248
52             8.4455
54             7.4956
56             8.4301
58             7.5022
60             8.4167
62             7.4635
64             8.4048
 ...
davem at patience:~/src/GMP/HG/build-sparc64-ultrasparct4$ ls -l mpn/*mul_2*
lrwxrwxrwx 1 davem davem   47 Mar 22 09:09 mpn/addmul_2.asm -> ../../gmp/mpn/sparc64/ultrasparct3/aormul_2.asm
-rw-r--r-- 1 davem davem  293 Mar 22 09:09 mpn/addmul_2.lo
-rw-r--r-- 1 davem davem 1369 Mar 22 09:09 mpn/addmul_2.o
lrwxrwxrwx 1 davem davem   47 Mar 22 09:09 mpn/mul_2.asm -> ../../gmp/mpn/sparc64/ultrasparct3/aormul_2.asm
-rw-r--r-- 1 davem davem  284 Mar 22 09:09 mpn/mul_2.lo
-rw-r--r-- 1 davem davem 1302 Mar 22 09:09 mpn/mul_2.o
davem at patience:~/src/GMP/HG/build-sparc64-ultrasparct4$ 

Something is adding some strange cost for the even sizes.


More information about the gmp-devel mailing list