This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Question about vec_extract
- From: "Andrew Pinski" <pinskia at gmail dot com>
- To: gcc at gcc dot gnu dot org
- Date: Wed, 12 Jul 2006 17:06:36 +0900
- Subject: 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?