Question

The following code:

simd(n, is)
long *is;
{   
   long i;
   asm("pxor %mm0,%mm0");
   for (i = 0; i < n; i += W) {

       asm("movq %0 %%mm1\n\t"
           "paddq %%mm1 %%mm0"
           :
           :"m"(is[i])          );

   }
   return 0;
}

I'm unable to understand why it fails to compile with the following error:

/tmp/ccrDnFTm.s: Assembler messages:
/tmp/ccrDnFTm.s:29: Error: suffix or operands invalid for `movq'
/tmp/ccrDnFTm.s:30: Error: junk `%mm0' after register

Why?

Was it helpful?

Solution

Operands must be separated by commas:

movq %0, %%mm1
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top