|
From: Rodrigo H. <kw...@ae...> - 2005-06-11 04:38:29
|
Hi, I am having trouble getting my inline asm SSE code right (everything seems in order, but runtime results are skewed), so I took a look at the GCC manual here: http://gcc.gnu.org/onlinedocs/gcc-3.4.4/gcc/Machine-Constraints.html#Machine-Constraints seems like I should be able to use the "x" constraint to specify a xmm register and turn this: asm ( "movups %0,%%xmm0\n\t" "movups %1,%%xmm1\n\t" "addps %%xmm1,%%xmm0\n\t" "movups %%xmm0,%2\n\t" : : "m" (var1[0]), "m" (var2[0]),"m"(result[0]) : "%xmm0", "%xmm1" ); into this: asm ( "addps %2,%1\n\t" "movups %1,%0\n\t" : "=x"(result[0]) : "x" (var1[0]), "x" (var2[0]) ); but I get an "impossible constraint in `asm'" error, now the variables here are 16 bit aligned float[4] arrays, my guess is that "x" is expecting a 128 bit type, I dont know what this type is. I looked for examples and found none, perhaps the constraint is too new, so does anyone actually know how to use it? Thanks. |