> >      in maemo-mapper I have a lot of code involved in doing 
> > transformations from latitude/longitude to Mercator 
> > coordinates (used in google maps, for example), calculation 
> > of distances, etc.
> >     
> >     I'm trying to use integer arithmetics as much as 
> > possible, but sometimes it's a bit impractical, and I wonder 
> > if it's really worth the trouble.

Is the code slow at the moment and is it specifically the fp stuff that's
slowing it down? If not, I'd say it's probably not worth the effort unless
you're doing this for fun/out of interest.

> >     Does one have any figure about how the performance of 
> > the FPU is, compared to integer operations?
> >     
> >     A practical question: should I use this way of 
> > computing the square root:
> >     
> > http://en.wikipedia.org/wiki/Methods_of_computing_square_roots
> > #Binary_numeral_system_.28base_2.29
> >     
> >     (but operating on 32 or even 64 bits), or would I be 
> > better using sqrtf() or sqrt()?

I'd suggest writing some benchmark code for the functions you wish to
compare.

> >     Does anyone know any tricks to optimize certain 
> > operations on arrays of data?

There are SIMD extensions
(http://www.arm.com/products/processors/technologies/dsp-simd.php).

> Basically, what we did with ThinX OS, is have a full blown 
> soft-float toolchain which then used the already proven and 
> highly optimized GCC's stack floating point operations. 
> However , Maemo is not soft float, so I'd recommend to 
> experiment with rebuilding Mapper using such a soft float 
> enabled toolchain, statically linked to avoid glitches to 
> system's libc or have a seperat LD_LIBRARY_PATH to avoid 
> memory hogging, and see where it gets you.

Soft-float is significantly slower than using the VFP hard-float (using
mfpu, etc., flags on GCC on the N900 and the N8x0 for that matter), there
should be emails containing benchmarks on the list from a long while back
otherwise I can dig them out again. But Alberto's situation is slightly
different as his integer-only code need not deal with arbitrary fp numbers
(as is the case for the soft-float code) as he knows what his inputs' ranges
will be, therefore he should be able to write more efficient and specialised
fixed point integer functions that avoid conversion to and from fp form and
that trim significant figures to the minimum he requires.

Cheers,


Simon

_______________________________________________
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers

Reply via email to