I have a piece of code both in C & as Inlined Assembly -
void add (float *a, float *b, float *c)
for (i = 0; i < 4; i++)
c[i] = a[i] + b[i];
and Inline asm code as -
void add(float *a, float *b, float *c)
asm (".intel_syntax noprefix\n\t"
"mov eax, a"
"mov edx, b"
"mov ecx, c"
"moovaps xmm0, XMMWORD PTR [eax]"
"addps xmm0, XMMWORD PTR [edx]"
"movaps XMMWORD PTR [ecx], xmm0"
The above C code was fine, no doubt on it but inline assembly code gave below error messages as -
$ icc add-simd.c
/tmp/iccW8zIXvas_.s: Assembler messages:
/tmp/iccW8zIXvas_.s:47: Error: too many memory references for 'mov'
Not able to interpret above error messages.
I know I am missing something as this is the first Inline asm I had written till date, so looking for above solutions and references to write Inline assembly using Intel C++ Compiler-v11.0 (ICC) on x86_64 linux machine.