Segher:

On Thu, 2020-08-20 at 16:50 -0500, Segher Boessenkool wrote:
> Hi!
> 
> On Tue, Aug 11, 2020 at 12:23:05PM -0700, Carl Love wrote:
> > +;; 128-bit int modes
> > +(define_mode_iterator VEC_I128 [V1TI TI])
> 
> We already have VSX_TI for this (in vsx.md).  Rename that to
> something
> without VSX, and move it to vector.md or such?  Maybe name it VEC_TI
> or anyTI.
> 
> Do that renaming as a separate patch before this one?  It is
> logically
> separate, and it is boring stuff, so putting it in a separate patch
> makes the non-boring stuff stand out more.
> 
> (It would be better if we could just get rid of V1TI, but that isn't
> going to happen soon).
> 
> > --- a/gcc/config/rs6000/vsx.md
> > +++ b/gcc/config/rs6000/vsx.md
> > @@ -367,7 +367,7 @@
> >     UNSPEC_INSERTR
> >     UNSPEC_REPLACE_ELT
> >     UNSPEC_REPLACE_UN
> > -   UNSPEC_XXSWAPD_V1TI
> > +   UNSPEC_XXSWAPD_VEC_I128
> 
> Why not just UNSPEC_XXSWAPD?  And, why an unspec at all?

I am trying to figure out how to specify this without using an unpsec
per your last comment.  I changed the definition to:

;; Swap upper/lower 64-bit values in V1TI or TI type                            
       
(define_insn "xxswapd_<mode>"                                                   
       
  [(set (match_operand:VEC_I128 0 "vsx_register_operand" "=v")                  
       
        (vec_select:VEC_I128                                                    
       
          (match_operand:VEC_I128 1 "vsx_register_operand" "v")                 
       
          (parallel [(const_int 0)])))]                                         
       
  "TARGET_POWER10"                                                              
       
;; AIX does not support extended mnemonic xxswapd.  Use the basic               
       
;; mnemonic xxpermdi instead.                                                   
       
  "xxpermdi %x0,%x1,%x1,2"                                                      
       
  [(set_attr "type" "vecperm")])


All of the swap definitions that I can see are based on using
vec_select which seems to be the issue here.  Not seeing anyway to do
this without using unspec.  Any thoughts?

                      Carl 

Reply via email to