Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
Announcements
The Intel sign-in experience has changed to support enhanced security controls. If you sign in, click here for more information.

Time for multimedia instructions

mancita
Beginner
168 Views

Hi,

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

#define tiempo(ciclos) asm volatile ("rdtsc ":"=A"(ciclos))

int aux,aux2;

long long int c1,c2;

main (int argc, char *argv[])

{

tiempo(c1);

asm volatile ("pxor %mm0, %mm0 ");

tiempo(c2);

aux = c2-c1;

tiempo(c1);

asm volatile ("pxor %mm1, %mm1 ");

tiempo(c2);

aux2 = c2-c1;

printf("Time first MMX instruction=%i ** Time second MMX instruction=%i ",aux,aux2);

}

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.

Thanks

0 Kudos
0 Replies
Reply