On Sun, Dec 22, 2019 at 11:24:51AM -0600, Segher Boessenkool wrote:
> Hi!
> 
> On Fri, Dec 20, 2019 at 06:47:28PM -0500, Michael Meissner wrote:
> > Then I realized that eventaully we will want to generate an X-FORM 
> > (register +
> > register) address, and it was just simpler to use the 'Q' constraint, and 
> > have
> > the register allocator put the address into a register.
> 
> Yep, good call.
> 
> >     * config/rs6000/vsx.md (vsx_extract_<mode>_var, VSX_D iterator):
> >     Use 'Q' for memory constraints because we need to do an X-FORM
> >     load with the variable index.
> >     (vsx_extract_v4sf_var): Use 'Q' for memory constraints because we
> >     need to do an X-FORM load with the variable index.
> 
> This comment is a headscratcher -- but you shouldn't say "why" in
> changelogs at all, so that is an easy fix ;-)
> 
> >     (vsx_extract_<mode>_var, VSX_EXTRACT_I iterator):Use 'Q' for
> 
> (missing space)
> 
> >     memory constraints because we need to do an X-FORM load with the
> >     variable index.
> >     (vsx_extract_<mode>_<VS_scalar>mode_var): Use 'Q' for memory
> >     constraints because we need to do an X-FORM load with the variable
> >     index.
> 
> (and more)
> 
> > -;; Variable V2DI/V2DF extract
> > +;; Variable V2DI/V2DF extract.  Use 'Q' for the memory because we will
> > +;; ultimately have to convert the address into base + index.
> 
> Maybe just don't write anything at all, since it is hard to explain in a
> few words?  It is clear that "Q" is not a usual constraint, anyway :-)
> 
> Okay for trunk like that.  Thanks!

This is the patch I committed (subversion id 279938):

2020-01-06  Michael Meissner  <meiss...@linux.ibm.com>

        * config/rs6000/vsx.md (vsx_extract_<mode>_var, VSX_D iterator):
        Use 'Q' for doing vector extract from memory.
        (vsx_extract_v4sf_var): Use 'Q' for doing vector extract from
        memory.
        (vsx_extract_<mode>_var, VSX_EXTRACT_I iterator): Use 'Q' for
        doing vector extract from memory.
        (vsx_extract_<mode>_<VS_scalar>mode_var): Use 'Q' for doing vector
        extract from memory.

Index: gcc/config/rs6000/vsx.md
===================================================================
--- gcc/config/rs6000/vsx.md    (revision 279910)
+++ gcc/config/rs6000/vsx.md    (working copy)
@@ -3248,7 +3248,7 @@ (define_insn "vsx_vslo_<mode>"
 ;; Variable V2DI/V2DF extract
 (define_insn_and_split "vsx_extract_<mode>_var"
   [(set (match_operand:<VS_scalar> 0 "gpc_reg_operand" "=v,wa,r")
-       (unspec:<VS_scalar> [(match_operand:VSX_D 1 "input_operand" "v,m,m")
+       (unspec:<VS_scalar> [(match_operand:VSX_D 1 "input_operand" "v,Q,Q")
                             (match_operand:DI 2 "gpc_reg_operand" "r,r,r")]
                            UNSPEC_VSX_EXTRACT))
    (clobber (match_scratch:DI 3 "=r,&b,&b"))
@@ -3318,7 +3318,7 @@ (define_insn_and_split "*vsx_extract_v4s
 ;; Variable V4SF extract
 (define_insn_and_split "vsx_extract_v4sf_var"
   [(set (match_operand:SF 0 "gpc_reg_operand" "=wa,wa,?r")
-       (unspec:SF [(match_operand:V4SF 1 "input_operand" "v,m,m")
+       (unspec:SF [(match_operand:V4SF 1 "input_operand" "v,Q,Q")
                    (match_operand:DI 2 "gpc_reg_operand" "r,r,r")]
                   UNSPEC_VSX_EXTRACT))
    (clobber (match_scratch:DI 3 "=r,&b,&b"))
@@ -3681,7 +3681,7 @@ (define_insn_and_split "*vsx_extract_<mo
 (define_insn_and_split "vsx_extract_<mode>_var"
   [(set (match_operand:<VS_scalar> 0 "gpc_reg_operand" "=r,r,r")
        (unspec:<VS_scalar>
-        [(match_operand:VSX_EXTRACT_I 1 "input_operand" "v,v,m")
+        [(match_operand:VSX_EXTRACT_I 1 "input_operand" "v,v,Q")
          (match_operand:DI 2 "gpc_reg_operand" "r,r,r")]
         UNSPEC_VSX_EXTRACT))
    (clobber (match_scratch:DI 3 "=r,r,&b"))
@@ -3701,7 +3701,7 @@ (define_insn_and_split "*vsx_extract_<mo
   [(set (match_operand:<VS_scalar> 0 "gpc_reg_operand" "=r,r,r")
        (zero_extend:<VS_scalar>
         (unspec:<VSX_EXTRACT_I:VS_scalar>
-         [(match_operand:VSX_EXTRACT_I 1 "input_operand" "v,v,m")
+         [(match_operand:VSX_EXTRACT_I 1 "input_operand" "v,v,Q")
           (match_operand:DI 2 "gpc_reg_operand" "r,r,r")]
          UNSPEC_VSX_EXTRACT)))
    (clobber (match_scratch:DI 3 "=r,r,&b"))

-- 
Michael Meissner, IBM
IBM, M/S 2506R, 550 King Street, Littleton, MA 01460-6245, USA
email: meiss...@linux.ibm.com, phone: +1 (978) 899-4797

Reply via email to