This is the mail archive of the gcc@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]

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


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


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