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]

Re: problem in extended asm


Ankit Jain wrote:
a simple question: why the followinf instruction
dosent work in gcc
asm("movq i(%1),%%mm0 \n"
    "movq %%mm0,(%0)
    :"=r"(x)
    :"r"(m));           //m is an array

Always include a testcase that can be compiled. A program fragment like this is a very poor bug report, as often the bug is in something you left out.


In this particular case, the problem is likely that you are using arrays, and register allocation can not assign an array to a register, at least not after you have referenced an element of it. Hence, you can not use an 'r' constraint with an array.

Try using a vector type or a union instead of an array.
--
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com


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