------- Comment #3 from pinskia at gcc dot gnu dot org  2007-06-04 07:50 -------
> > Also it seems like you could use register asm("xmm0") to get the correct
> > register to be used.
> But please note that "c" argument is passed to the function via xmm2.
So this is why GCC has register asm() extension is to get the correct register
to be used.  The code would look like:
typedef float V4SFmode __attribute__((vector_size(16)));

V4SFmode t (V4SFmode a, V4SFmode b, V4SFmode c)
{
 V4SFmode ret;
 register V4SFmode c1 asm("xmm0");
 c1 = c;

 asm ("blenvdps %0, %2, %3" : "=x" (ret) : "0" (a), "x" (b), "x" (c1));
 return ret;
}

Since c1 is already in xmm0, the register allocator knows it cannot use a as
xmm0 so there is still a move before the other move and after the asm.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32201

Reply via email to