FPU / integer performance

Simon
Just thought it might interest someone... I've been optimising a 3D engine
(written only for the CPU, since we don't have OpenGL) and made some
timings of integer vs float performance. The (trivial) code is at
http://0x0000ff.com/src/math.c, and it's compiled and installed using:

  prompt% arm-linux-gcc -O2 -o t math.c
  prompt% lftp -c "open 192.168.1.11 -u 6410,6410; put t -o t"

Here's what I get:


[root@6410 /sdcard]# ./t
Division:
   Ints: 0.894195 (162725365)
 Floats: 1.084420 (146314368.000000)
 Ratio: 1.212733
Multiplication:
   Ints: 0.095186 (0)
 Floats: 0.247450 (0.000000)
 Ratio: 2.599647
Addition:
   Ints: 0.076059 (-2014260030)
 Floats: 0.247430 (48714878025728.000000)
 Ratio: 3.253132
Subtraction:
   Ints: 0.076480 (2014260034)
 Floats: 0.247376 (-48714878025728.000000)
 Ratio: 3.234519

The 'Ratio' line is the speed-up of using integer vs floating point (I was
investigating creating a fixed-point system, doesn't really seem worth it
for these figures, given all the extra bit-shifting involved). 

Simon