Clarification Req: Regarding "+m" constraints in inline asm

Ashok.A ashok_kumar_ak@yahoo.com
Wed Mar 3 14:44:00 GMT 2004


Hi All,

I need clarification regarding the "+m" constraints.
I heard that "+m" constraints cannot be used
in "inline asm". Is it true?

Example:

----------
  int temp;
  asm ("lw %0,%1     \n\t"
       "addu %0,%0,1 \n\t"
       "sw %0,%1"
       : "=r" (temp), "=m" (data)  /* outputs */
       : "1" (data));              /* inputs  */
----------

  Can I use the following instead of the above?
  Will it be exactly same as above?

----------
  int temp;
  asm ("lw %0,%1     \n\t"
       "addu %0,%0,1 \n\t"
       "sw %0,%1"
       : "=r" (temp), "+m" (data)  /* outputs */
----------

I believe "+m" constraint is processor independent.
Anyhow, I need clarification for MIPS processor.

It would be great help if you can clarify this
issue. Thanks in advance.

Thanks,
Ashok

__________________________________
Do you Yahoo!?
Yahoo! Search - Find what youÂ’re looking for faster
http://search.yahoo.com



More information about the Gcc mailing list