Scatter/Gather vector operations

Dzonatas dzonatas@dzonux.net
Sat Apr 7 19:51:00 GMT 2007


Hello,

Please, help me figure out how to trigger the scatter/gather 
(pack/unpack) vector operations in gcc.

I need to move data from four pointer locations to a vector and vice 
versa with no extra in-line asm(). Currently, I have code that looks 
like this:

typedef union
{
float    f[4] ;
v4sf    v ;
} vector[100] ;

for( i=100; --i>=0;) {
row1[i] = vector[i].f[0];
row2[i] = vector[i].f[1];
row3[i] = vector[i].f[2];
row4[i] = vector[i].f[3];
            }


Is this the only portable way to do to a pack/unpack without asm()? How 
do I set it up differently to trigger a pack/unpack optimization?

Thank you.



More information about the Gcc-help mailing list