Hi Philip.
Philip N Daly wrote:
>
> 1. How long (in ns, us, ms) it takes to execute a floating point
> operation in C and x86 assembler on a 500MHz Pentium III?
with gcc (sorry but I only tryed with linux) the C compilation is very
good
and is very near ( sometime better ) that you can do in asm yourself.
The times for floating point operation is hard to quantify, cause some
operation like
'fdiv' or 'fsqrt' take up to 140 cycles time depending of the datas
against 1-2 cycles for 'fadd'.
for exemple, to convert Red Blue Green to Hue Saturation Luminace datas
of pictures,
on a 100x100 32bits pixels :
u1 = b-(0.5*r)-(0.5*g) ;
u2 = ((3/2)*r)-((3/2)*g) ;
L = (r+g+b)/3 ;
S = sqrt(u1^2+u2^2) ;
H = atan(u1/u2) ;
I got ~12ms ( measured with oscilloscope on parallel port ) which mean
about 1,2us per pixel ...
So count as a few ns for each floating point operation but care of hard
math function (~5ns->~700ns!).
Chris.
--
Kumsta Christophe
<[EMAIL PROTECTED]>
Real-Time System developper
RT-Linux/RTAI ( Use the Source Luck !)
--- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
----
For more information on Real-Time Linux see:
http://www.rtlinux.org/~rtlinux/