[Ffmpeg-devel] yet another silly int vs. float benchmark
matthieu castet
castet.matthieu
Sat May 21 20:08:51 CEST 2005
Michael Niedermayer wrote:
> Hi
>
> heres another benchmark proggy, advantages over the others
> 1. pure c
> 2. ~40 lines of code, can be easily done in less i know ...
> 3. tries to test both the case where each instruction depends upon the
> previous one and where the instructions are a little more independant
>
spar64 TI UltraSparc I (SpitFire) / UltraSparc I integrated FPU
I have to redefine get_cycle as the code is in the kernel
(/usr/src/linux-2.4.27/arch/sparc64/kernel/time.c)
#define TICK_PRIV_BIT (1UL << 63)
static inline long get_cycles() { long ret; \
__asm__ __volatile__("rd %%tick, %0\n\t" \
"mov %0, %0" \
: "=r" (ret)); \
return ret & ~TICK_PRIV_BIT; }
I hope it is right.
100 ; needed 7 cycles -> 7 cycles per operation
100 iv[0]+=iv[1];iv[1]+=iv[0]; needed 209 cycles -> 104 cycles per
operation
100 iv[0]*=iv[1];iv[1]*=iv[0]; needed 1011 cycles -> 505 cycles per
operation
100 fv[0]+=fv[1];fv[1]+=fv[0]; needed 607 cycles -> 303 cycles per
operation
100 fv[0]*=fv[1];fv[1]*=fv[0]; needed 607 cycles -> 303 cycles per
operation
100 iv[0]+=iv[1];iv[1]+=iv[2];iv[2]+=iv[3];iv[3]+=iv[4];iv[4]+=iv[5];
needed 264 cycles -> 52 cycles per operation
100 iv[0]*=iv[1];iv[1]*=iv[2];iv[2]*=iv[3];iv[3]*=iv[4];iv[4]*=iv[5];
needed 2517 cycles -> 503 cycles per operation
100 fv[0]+=fv[1];fv[1]+=fv[2];fv[2]+=fv[3];fv[3]+=fv[4];fv[4]+=fv[5];
needed 512 cycles -> 102 cycles per operation
100 fv[0]*=fv[1];fv[1]*=fv[2];fv[2]*=fv[3];fv[3]*=fv[4];fv[4]*=fv[5];
needed 512 cycles -> 102 cycles per operation
More information about the ffmpeg-devel
mailing list