[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Data types (was: Re: Access the neighbors of an element)
From: |
Paul Kienzle |
Subject: |
Re: Data types (was: Re: Access the neighbors of an element) |
Date: |
Tue, 15 Feb 2005 07:38:24 -0500 |
On Feb 14, 2005, at 8:41 PM, John W. Eaton wrote:
On 14-Feb-2005, Paul Kienzle <address@hidden> wrote:
| This message didn't get back to me. Was it perhaps a problem with
the
| attachment?
I saw it and it made it to the archives:
http://www.octave.org/mailing-lists/help-octave/2005/384
I don't understand why I didn't see it on my box.
I did want it for general distribution so that those who may be
motivated to have faster integer ops can do the necessary work.
Sorry I haven't had time to comment on it yet. I think it is a nice
idea, but since you show that the speedups vary, we will need some
configure or (better) runtime tests to decide exactly what code to
use.
The speedup on Intel is so big:
$ gcc -O2 uint.c -DLONG -DDOUBLESAT -DADD; time ./a.out 5
real 0m20.633s
$ gcc -O2 uint.c -DLONG -DSAT -DADD; time ./a.out 5
real 0m1.550s
$ gcc -O2 uint.c -DLONG -DNOSAT -DADD; time ./a.out 5
real 0m0.973s
$ gcc -O2 uint.c -DLONG -DDOUBLESAT -DMULT; time ./a.out 5
real 0m11.064s
$ gcc -O2 uint.c -DLONG -DSAT -DMULT; time ./a.out 5
real 0m1.886s
$ gcc -O2 uint.c -DLONG -DNOSAT -DMULT; time ./a.out 5
real 0m1.035s
that the slight slowdown on MIPS is a minor sacrifice:
$ cc uint.c -O2 -DLONG -DDOUBLESAT -DMULT; time ./a.out 10
real 0m1.723s
$ cc uint.c -O2 -DLONG -DSAT -DMULT; time ./a.out 10
real 0m2.209s
which is outweighed by the gains in other operations:
$ cc uint.c -O2 -DLONG -DDOUBLESAT -DADD; time ./a.out 10
real 0m1.783s
$ cc uint.c -O2 -DLONG -DSAT -DADD; time ./a.out 10
real 0m0.654s
$ cc uint.c -O2 -DLONG -DNOSAT -DADD; time ./a.out 10
real 0m0.418s
Also, the LONGLONG case should be changed regardless since
casting to a double loses precision.
- Paul
- Re: Data types (was: Re: Access the neighbors of an element),
Paul Kienzle <=