Hello, 

> Here's an example program that you can test and time yourself. 
> 
> On my Core 2, I get
> 
>       [EMAIL PROTECTED] ~]$ gcc -DCMOV -Wall -O2 t.c
>       [EMAIL PROTECTED] ~]$ time ./a.out
>       600000000
> 
>       real    0m0.194s
>       user    0m0.192s
>       sys     0m0.000s
> 
>       [EMAIL PROTECTED] ~]$ gcc -Wall -O2 t.c
>       [EMAIL PROTECTED] ~]$ time ./a.out
>       600000000
>       
>       real    0m0.167s
>       user    0m0.168s
>       sys     0m0.000s

Test was done on my laptop with gcc 4.1.1 and CPU:

processor       : 0
vendor_id       : GenuineIntel
cpu family      : 15
model           : 2
model name      : Intel(R) Pentium(R) 4 CPU 2.40GHz
stepping        : 9
cpu MHz         : 2392.349
cache size      : 512 KB
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 2
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 sep mtrr pge mca cmov pat 
pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe cid xtpr
bogomips        : 4786.36
clflush size    : 64

I wrote a simple script that run each version of your code 100
times measuring the execution time. Then some simple gnuplot
magic was applied. The result is attached (png file).

- cmovne was faster with almost stable execution time (~171ms)
- je-mov was slower and execution time varies

Interpretation is up to you ;-)

-- 
Regards,

        Mariusz Kozlowski

Attachment: benchmark.png
Description: PNG image

Reply via email to