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?





> First, what is the (const_int 4) for?  Vec_duplicate only takes one
> argument.

indeed. this extra argument is redundant.

> Second, and most importantly, the above assumes vec_duplicate can
> duplicate scalars.

yes. grepping around I found vec_duplicate used this way in other targets
(sh.md, i386.md).

> What do you think?  Should VEC_DUPLICATE handle scalars?

I think it should.

> Could y'all
> involved with middle-end vector issues decide?

as I said before, I prefer the vec_duplicate solution because its more
informative.

dorit





                                                                                                                                
                      Aldy Hernandez                                                                                            
                      <aldyh@redhat.com        To:       Dorit Naishlos/Haifa/IBM@IBMIL                                         
                      >                        cc:       David Edelsohn <dje@watson.ibm.com>, gcc@gcc.gnu.org                   
                                               Subject:  Re: RFC: PR14880 vec_duplicate or vec_select?                          
                      11/11/2004 22:33                                                                                          
                                                                                                                                




Upon further investigation... I'm seeing all sorts of missing middle
end magic here...

> how about something like -
>
> (vec_duplicate:V4SI
>    (vec_select:SI (reg:V4SI v1)
>                   (parallel [(const_int 3)]))
>    (const_int 4))

First, what is the (const_int 4) for?  Vec_duplicate only takes one
argument.

Second, and most importantly, the above assumes vec_duplicate can
duplicate scalars.

The documentation is vague, but the argument could be made that it refers
only to input and outputs of vectors.

I know for a fact that the only place that deals with VEC_DUPLICATE
(simplify_unary_operation) specifically outlaws scalars as input:

  if (code == VEC_DUPLICATE)
    {
      gcc_assert (VECTOR_MODE_P (mode));

So...unless y'all decide that VEC_DUPLICATE should handle scalars, we're
back to my other implementation, which will no doubt need further
middle end machinery, but that's a separate issue:

          (vec_select:V4SI (reg:V4SI v1)
                           (parallel [(const_int 3)
                                      (const_int 3)
                                      (const_int 3)
                                      (const_int 3)])))

What do you think?  Should VEC_DUPLICATE handle scalars?  Could y'all
involved with middle-end vector issues decide?

Cheers.
Aldy



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