Time for multimedia instructions

Time for multimedia instructions


I have generated with icc the executable file for this source code:

#define tiempo(ciclos) asm volatile ("rdtsc

int aux,aux2;

long long int c1,c2;

main (int argc, char *argv[])



asm volatile ("pxor %mm0, %mm0


aux = c2-c1;


asm volatile ("pxor %mm1, %mm1


aux2 = c2-c1;

printf("Time first MMX instruction=%i ** Time second MMX instruction=%i


The program output is:

Time first MMX instruction=47 ** Time second MMX instruction=47

I have generated with icc the assembler code for this source code and I have erased the subroutine call to __intel_proc_initand then recompiled.. For this last executable we obtain outputs like these:

Time first MMX instruction=1489 ** Time second MMX instruction=47

Time first MMX instruction=1509 ** Time second MMX instruction=47

These last outputs are more similar to those obtained compiling with gcc (4.0.0).

Why it is so different the time for the execution of the first MMX instruction (without the previous call to __intel_proc_init)and why it is so high. Why it is so high the time for the first MMX instruction compared to the time of the next MMX instructions. Why the time of the first MMX instruction is lower when using the subroutine __intel_proc_init.

It must be something related to multimedia instructions, since I have checked with non-multimedia instructions and this does not happen.


1 post / 0 new
For more complete information about compiler optimizations, see our Optimization Notice.