This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
problem with pointers in asm
- From: Ankit Jain <ankitjain1580 at yahoo dot com>
- To: Fredrik Olofsson <frol at linux dot nu>, gcc <gcc-help at gcc dot gnu dot org>
- Date: Wed, 11 Aug 2004 09:38:53 +0100 (BST)
- Subject: problem with pointers in asm
thanks but still i am not clear how m1 is input to
asm()?
and if u can explain this " "memory" since your asm()
changes memory."
thanks
ankit
--- Fredrik Olofsson <frol@linux.nu> wrote:
> On Wed, Aug 11, 2004 at 07:35:56AM +0100, Ankit Jain
> wrote:
> > 14 asm("movq (%1), %%mm0 \n"
> > 15 "movq %%mm0, (%0) \n"
> > 16 :"=r"(m1)
> > 17 :"r"(m)
> > 18 );
>
> m1 is used as an input to the asm(), so adding
> "r"(m1) to line 17 and removing it from line 16
> fixes the problem. Probably you should also add a
> line 17.5 : "memory" since your asm() changes
> memory.
>
> asm("movq (%1), %%mm0 \n"
> "movq %%mm0, (%0) \n"
> :
> : "r"(m1), "r"(m)
> : "memory"
> );
>
> Cheers,
> /Fredrik
>
________________________________________________________________________
Yahoo! Messenger - Communicate instantly..."Ping"
your friends today! Download Messenger Now
http://uk.messenger.yahoo.com/download/index.html