Re:Re: help with MMX and inline asm (all ok)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



All ok

----------------------------------------------------
#include <stdio.h>

//file: mmx.c
// gcc -o mmx -Wall -mmmx mmx.c ( it run also without
-mmmx flag)

int main ( void ){
  int v[2] = { 5, 8};
  int t[2] = { 6, 17};
  int r[2] = { 0, 0};
  printf("V: %i  %i\n",v[0], v[1]);
  printf("T: %i  %i\n",t[0], t[1]);
  printf("R: %i  %i\n",r[0], r[1]);
    asm (
       "movq %0 , %%mm1\n\t"
       "movq %1 , %%mm0\n\t"
       "paddd %%mm0, %%mm1\n\t"
       "movq %%mm1, %2\n\t"
       :"=m" (v[0]) // %0 first array
       :"m" (t[0]), // %1 second array
       "m" (r[0]) // %2 result
       );
   printf("\n\nV: %i  %i\n",v[0], v[1]);
   printf("T: %i  %i\n",t[0], t[1]);
   printf("R: %i  %i\n",r[0], r[1]);
  return 0;
}
-----------------------------------------------

______________________________________________________________________
Yahoo! Mail: 6MB di spazio gratuito, 30MB per i tuoi allegati, l'antivirus, il filtro Anti-spam
http://it.yahoo.com/mail_it/foot/?http://it.mail.yahoo.com/

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux