This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Question about vec_extract


I have been trying to figure out when the pattern vec_extract is
invoked.  I understand it is invoked from extract_bit_field but I
don't see how it can be invoked.  For both SSE and altivec I have
tried the following code (which I thought would cause vec_extract
pattern to be called) but on both, it is not.
Does anyone know to get vec_extract working, or is it broken in 4.0.0 and above?

#define vector __attribute__((vector_size(16)))
vector float t;
float g(vector float t)
{
 union
 {
   vector float vf;
   float f[4];
 }t1;
 t1.vf = t;
 return t1.f[1];
}

Thanks,
Andrew Pinski

PS, right now on PPC64, there are extra instructions done for the
above code as the union is done in TI mode which causes us to use
subregs and then spill to the stack twice.  Maybe the union should be
the mode of the vector, V4SF?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]