On Wed, Jun 29, 2016 at 05:20:26PM -0500, Segher Boessenkool wrote:
> On Wed, Jun 29, 2016 at 03:33:24PM -0400, Michael Meissner wrote:
> > Is it ok to install in the trunk?
> 
> See comments below.  Okay with that taken care of.
> 
> > Ideally, I would like to also install it on the GCC 6.2 branch.  Note, it
> > depends on the June 15th changes to allow DImode into Altivec registers, and
> > the fix for PR 71677 that was submitted on June 27th being installed before
> > these patches can be applied.
> 
> Is the DImode thing not on trunk yet?

The DImode patch is on the trunk.  It is not on 6.2, and in fact since this
patch fixes a bug in that patch, both patches need to be applied at the same
time.

> > Assuming the above patches are supplied can I back port it to the GCC 6.2 
> > after
> > a burn-in period?
> 
> Yes, thanks.
> 
> 
> > +;; Mode attribute to give the instruction for vector extract.  %3 contains 
> > the
> > +;; adjusted element count.
> > +(define_mode_attr VSX_EXTRACT_INSN [(V16QI "vextractub %0,%1,%3")
> > +                               (V8HI  "vextractuh %0,%1,%3")
> > +                               (V4SI  "xxextractuw %x0,%x1,%3")])
> 
> Could you use %2 instead, please?  Much less surprising.  And please inline
> it in the one place it is used.

I generally don't like overwriting exisiting arguments when you are doing the
modification, but I can use %2 if you prefer.

> > +(define_insn  "vsx_extract_<mode>_di"
> > +  [(set (match_operand:DI 0 "gpc_reg_operand" "=<VSX_EX>")
> > +   (zero_extend:DI
> > +    (vec_select:<VS_scalar>
> > +     (match_operand:VSX_EXTRACT_I 1 "gpc_reg_operand" "<VSX_EX>")
> > +     (parallel [(match_operand:QI 2 "<VSX_EXTRACT_PREDICATE>" "n")]))))]
> > +  "VECTOR_MEM_VSX_P (<MODE>mode) && TARGET_VEXTRACTUB"
> > +{
> > +  int element = INTVAL (operands[2]);
> > +  int unit_size = GET_MODE_UNIT_SIZE (<MODE>mode);
> > +  int offset = ((VECTOR_ELT_ORDER_BIG)
> > +           ? unit_size * element
> > +           : unit_size * (GET_MODE_NUNITS (<MODE>mode) - 1 - element));
> > +
> > +  operands[3] = GEN_INT (offset);
> > +  return "<VSX_EXTRACT_INSN>";
> > +}
> 
> So that would be
> 
>   operands[2] = GEN_INT (offset);
>   if (unit_size == 4)
>     return "xxextractuw %x0,%x1,%2";
>   else
>     return "vextractu<wd> %0,%1,%2";

Ok.

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

Reply via email to