[Ffmpeg-devel] int vs. float: Hard Numbers

Mike Melanson mike
Fri May 20 23:15:04 CEST 2005


Rich Felker wrote:
> On Fri, May 20, 2005 at 12:46:24PM -0600, Mike Melanson wrote:
> 
>>  rdtsc            ; get a timestamp
>>  mov    ebx, eax  ; save the lower 32 bits of the timestamp
>>  mov    eax, 1    ; set up the base for multiplication
>>  times ITERATIONS  mul  ecx  ; perform n int mults (eax *= ecx)
>>  mov    ecx, eax  ; save the final product before fetching timestamp
>>  rdtsc            ; get another timestamp
> 
> 
> Each mul depends on the output of the previous one. Very bad test...
> :)

	Not sure how to devise a test that would run a series of tight series 
mul instructions without the dependency problem.

	Soooo... let's set ITERATIONS to 1 (disregard the parenthetical counts):

integer_adder() (10 adds) returned 5, 27 cycles used
float_adder() (10 adds) returned 5.000000, 27 cycles used
integer_mult() (10 mults) returned 5, 34 cycles used
float_mult() (10 mults) returned 5.000000, 27 cycles used

Given that the non-instruction-related overhead is known to be 26 
cycles, well, I think you can do the math on the instruction 
performance. You really can't do better than 1 clock cycle.

-- 
	-Mike Melanson





More information about the ffmpeg-devel mailing list