This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]