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]

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



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