Original Post
Hi,
variable names cannot be accessed from gcc inline asm unless they're declared globally, right? This works fine for me:
//Somewhere global:
float a[4] __attribute__ ((aligned(16))) = { 1.0, 2.0, 3.0, 4.0 };
float b[4] __attribute__ ((aligned(16))) = { 3.0, 2.0, 1.0, 0.0 };
//Somewhere in a function body
...
asm("movaps _a, %xmm0
movaps _b, %xmm1
mulps %xmm0, %xmm1");
The result is { 3.0, 4.0, 3.0, 0.0 } (The two vectors get multiplied).
But I'd like to define a and b locally and use extended inline asm. I know that gcc supports something like this: asm(operation : output : input : clobbers). The problem is, that I couldn't get the whole array a (and b) into one register so that I could access it with %0 or %1 or whatever. As I said before, this works fine if I access the variables direclty.
I hope anyone can help me with this...
TIA
Flo
[edited by - ZMaster on April 25, 2004 8:52:06 AM]