This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: RFC: PR14880 vec_duplicate or vec_select?
- From: Dorit Naishlos <DORIT at il dot ibm dot com>
- To: Aldy Hernandez <aldyh at redhat dot com>
- Cc: David Edelsohn <dje at watson dot ibm dot com>, gcc at gcc dot gnu dot org
- Date: Sun, 7 Nov 2004 15:12:26 +0200
- Subject: Re: RFC: PR14880 vec_duplicate or vec_select?
> > The Altivec vspltM (vec_splat) instruction sets each element
of
> > the result to the specified element of the input vector. One could
> > describe it as selecting the same source vector sub part into each
element
> > of the result (vec_select) or duplicating the 1-element sub-vector into
> > all elements (vec_duplicate). I am not sure how this should be
> > canonicalized in GCC or if there already is a preferred form.
>
> Precisely my question. Anyone? Dorit? Once we decide what is the
> preferred form, we should update the documentation (which is severely
> lacking for vec_* rtl).
the vec_duplicate version seems to be potentially more informative.
> BTW, if we should use vec_duplicate, how would you express getting the
> 1-element sub-vector out? It looks to me like vec_select is appropriate.
how about something like -
(vec_duplicate:V4SI
(vec_select:SI (reg:V4SI v1)
(parallel [(const_int 3)]))
(const_int 4))
?
> BTW2, perhaps I'm not looking hard enough, but I don't see anywhere in
> GCC where we're using vec_select or vec_duplicate. Mind you, we must
> get away from the unspec's eventually...
I found a couple occurrences of VEC_SELECT/VEC_DUPLICATE in simplify-rtx.c,
combine.c.
dorit
Aldy Hernandez
<aldyh@redhat.com To: David Edelsohn <dje@watson.ibm.com>
> cc: Dorit Naishlos/Haifa/IBM@IBMIL, gcc@gcc.gnu.org
Subject: Re: RFC: PR14880 vec_duplicate or vec_select?
06/11/2004 13:00
> The Altivec vspltM (vec_splat) instruction sets each element
of
> the result to the specified element of the input vector. One could
> describe it as selecting the same source vector sub part into each
element
> of the result (vec_select) or duplicating the 1-element sub-vector into
> all elements (vec_duplicate). I am not sure how this should be
> canonicalized in GCC or if there already is a preferred form.
Precisely my question. Anyone? Dorit? Once we decide what is the
preferred form, we should update the documentation (which is severely
lacking for vec_* rtl).
BTW, if we should use vec_duplicate, how would you express getting the
1-element sub-vector out? It looks to me like vec_select is appropriate.
BTW2, perhaps I'm not looking hard enough, but I don't see anywhere in
GCC where we're using vec_select or vec_duplicate. Mind you, we must
get away from the unspec's eventually...
Aldy