public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Andrea Pretto" <andrea_pretto@yahoo.it>
To: gcc-help@gcc.gnu.org
Subject: Re:Re: help with MMX and inline asm (all ok)
Date: Fri, 09 Apr 2004 09:09:00 -0000	[thread overview]
Message-ID: <20040409090946.64151.qmail@web60201.mail.yahoo.com> (raw)

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/

             reply	other threads:[~2004-04-09  9:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-09  9:09 Andrea Pretto [this message]
2004-04-09 13:54 ` Ian Lance Taylor
2004-04-10 11:27 Andrea Pretto

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040409090946.64151.qmail@web60201.mail.yahoo.com \
    --to=andrea_pretto@yahoo.it \
    --cc=gcc-help@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).