Re: [PATCH, rs6000] Add expansions for min/max vector reductions

2015-09-18 Thread Richard Biener
On Thu, 17 Sep 2015, Bill Schmidt wrote: > On Thu, 2015-09-17 at 09:18 -0500, Bill Schmidt wrote: > > On Thu, 2015-09-17 at 09:39 +0200, Richard Biener wrote: > > > On Wed, 16 Sep 2015, Alan Lawrence wrote: > > > > > > > On 16/09/15 17:10, Bill Schmidt wrote: > > > > > > > > > > On Wed,

Re: [PATCH, rs6000] Add expansions for min/max vector reductions

2015-09-18 Thread Richard Biener
On Thu, 17 Sep 2015, Segher Boessenkool wrote: > On Thu, Sep 17, 2015 at 09:18:42AM -0500, Bill Schmidt wrote: > > On Thu, 2015-09-17 at 09:39 +0200, Richard Biener wrote: > > > So just to clarify - you need to reduce the vector with max to a scalar > > > but want the (same) result in all vector

Re: [PATCH, rs6000] Add expansions for min/max vector reductions

2015-09-18 Thread Bill Schmidt
On Fri, 2015-09-18 at 10:38 +0200, Richard Biener wrote: > On Thu, 17 Sep 2015, Segher Boessenkool wrote: > > > On Thu, Sep 17, 2015 at 09:18:42AM -0500, Bill Schmidt wrote: > > > On Thu, 2015-09-17 at 09:39 +0200, Richard Biener wrote: > > > > So just to clarify - you need to reduce the vector

Re: [PATCH, rs6000] Add expansions for min/max vector reductions

2015-09-18 Thread Richard Biener
On Fri, 18 Sep 2015, Bill Schmidt wrote: > On Fri, 2015-09-18 at 10:38 +0200, Richard Biener wrote: > > On Thu, 17 Sep 2015, Segher Boessenkool wrote: > > > > > On Thu, Sep 17, 2015 at 09:18:42AM -0500, Bill Schmidt wrote: > > > > On Thu, 2015-09-17 at 09:39 +0200, Richard Biener wrote: > > > >

Re: [PATCH, rs6000] Add expansions for min/max vector reductions

2015-09-18 Thread Bill Schmidt
On Fri, 2015-09-18 at 15:15 +0200, Richard Biener wrote: > On Fri, 18 Sep 2015, Bill Schmidt wrote: > > > On Fri, 2015-09-18 at 10:38 +0200, Richard Biener wrote: > > > On Thu, 17 Sep 2015, Segher Boessenkool wrote: > > > > > > > On Thu, Sep 17, 2015 at 09:18:42AM -0500, Bill Schmidt wrote: > >

Re: [PATCH, rs6000] Add expansions for min/max vector reductions

2015-09-18 Thread Alan Lawrence
On 18/09/15 09:35, Richard Biener wrote: Btw, we ditched the original reduce-to-vector variant due to its endianess issues (it only had _one_ element of the vector contain the reduction result). Re-introducing reduce-to-vector but with the reduction result in all elements wouldn't have any

Re: [PATCH, rs6000] Add expansions for min/max vector reductions

2015-09-17 Thread Richard Biener
On Wed, 16 Sep 2015, Alan Lawrence wrote: > On 16/09/15 17:10, Bill Schmidt wrote: > > > > On Wed, 2015-09-16 at 16:29 +0100, Alan Lawrence wrote: > > > On 16/09/15 15:28, Bill Schmidt wrote: > > > > 2015-09-16 Bill Schmidt > > > > > > > > *

Re: [PATCH, rs6000] Add expansions for min/max vector reductions

2015-09-17 Thread Bill Schmidt
On Thu, 2015-09-17 at 09:18 -0500, Bill Schmidt wrote: > On Thu, 2015-09-17 at 09:39 +0200, Richard Biener wrote: > > On Wed, 16 Sep 2015, Alan Lawrence wrote: > > > > > On 16/09/15 17:10, Bill Schmidt wrote: > > > > > > > > On Wed, 2015-09-16 at 16:29 +0100, Alan Lawrence wrote: > > > > > On

Re: [PATCH, rs6000] Add expansions for min/max vector reductions

2015-09-17 Thread Bill Schmidt
On Thu, 2015-09-17 at 09:39 +0200, Richard Biener wrote: > On Wed, 16 Sep 2015, Alan Lawrence wrote: > > > On 16/09/15 17:10, Bill Schmidt wrote: > > > > > > On Wed, 2015-09-16 at 16:29 +0100, Alan Lawrence wrote: > > > > On 16/09/15 15:28, Bill Schmidt wrote: > > > > > 2015-09-16 Bill Schmidt

Re: [PATCH, rs6000] Add expansions for min/max vector reductions

2015-09-17 Thread Segher Boessenkool
On Thu, Sep 17, 2015 at 09:18:42AM -0500, Bill Schmidt wrote: > On Thu, 2015-09-17 at 09:39 +0200, Richard Biener wrote: > > So just to clarify - you need to reduce the vector with max to a scalar > > but want the (same) result in all vector elements? > > Yes. Alan Hayward's cond-reduction patch

Re: [PATCH, rs6000] Add expansions for min/max vector reductions

2015-09-16 Thread David Edelsohn
On Wed, Sep 16, 2015 at 10:28 AM, Bill Schmidt wrote: > Hi, > > A recent patch proposal from Alan Hayward > (https://gcc.gnu.org/ml/gcc-patches/2015-09/msg00690.html) uncovered > that the PowerPC back end doesn't have expansions for > reduc_{smax,smin,umax,umin}_ and

[PATCH, rs6000] Add expansions for min/max vector reductions

2015-09-16 Thread Bill Schmidt
Hi, A recent patch proposal from Alan Hayward (https://gcc.gnu.org/ml/gcc-patches/2015-09/msg00690.html) uncovered that the PowerPC back end doesn't have expansions for reduc_{smax,smin,umax,umin}_ and reduc_{smax,smin,umax,umin}_scal_ for the integer modes. This prevents vectorization of

Re: [PATCH, rs6000] Add expansions for min/max vector reductions

2015-09-16 Thread Ramana Radhakrishnan
On Wed, Sep 16, 2015 at 3:34 PM, David Edelsohn wrote: > On Wed, Sep 16, 2015 at 10:28 AM, Bill Schmidt > > This is okay. > > I don't think that I have seen iterators for UNSPECs, but maybe > someone else is aware of the right idiom.

Re: [PATCH, rs6000] Add expansions for min/max vector reductions

2015-09-16 Thread Bill Schmidt
On Wed, 2015-09-16 at 15:37 +0100, Ramana Radhakrishnan wrote: > On Wed, Sep 16, 2015 at 3:34 PM, David Edelsohn wrote: > > On Wed, Sep 16, 2015 at 10:28 AM, Bill Schmidt > > > > > This is okay. > > > > I don't think that I have seen iterators for UNSPECs, but maybe > >

Re: [PATCH, rs6000] Add expansions for min/max vector reductions

2015-09-16 Thread Segher Boessenkool
On Wed, Sep 16, 2015 at 09:28:09AM -0500, Bill Schmidt wrote: > I was able to use iterators for the sub-doubleword ...scal_ > expansions, but that's all. I experimented with trying to use > code_iterators to generate the {smax,smin,umax,umin} expansions, but > couldn't find a way to make that

Re: [PATCH, rs6000] Add expansions for min/max vector reductions

2015-09-16 Thread Bill Schmidt
On Wed, 2015-09-16 at 10:14 -0500, Segher Boessenkool wrote: > On Wed, Sep 16, 2015 at 09:28:09AM -0500, Bill Schmidt wrote: > > I was able to use iterators for the sub-doubleword ...scal_ > > expansions, but that's all. I experimented with trying to use > > code_iterators to generate the

Re: [PATCH, rs6000] Add expansions for min/max vector reductions

2015-09-16 Thread Alan Lawrence
On 16/09/15 15:28, Bill Schmidt wrote: 2015-09-16 Bill Schmidt * config/rs6000/altivec.md (UNSPEC_REDUC_SMAX, UNSPEC_REDUC_SMIN, UNSPEC_REDUC_UMAX, UNSPEC_REDUC_UMIN, UNSPEC_REDUC_SMAX_SCAL, UNSPEC_REDUC_SMIN_SCAL,

Re: [PATCH, rs6000] Add expansions for min/max vector reductions

2015-09-16 Thread Alan Lawrence
On 16/09/15 17:10, Bill Schmidt wrote: On Wed, 2015-09-16 at 16:29 +0100, Alan Lawrence wrote: On 16/09/15 15:28, Bill Schmidt wrote: 2015-09-16 Bill Schmidt * config/rs6000/altivec.md (UNSPEC_REDUC_SMAX, UNSPEC_REDUC_SMIN,

Re: [PATCH, rs6000] Add expansions for min/max vector reductions

2015-09-16 Thread Bill Schmidt
On Wed, 2015-09-16 at 16:29 +0100, Alan Lawrence wrote: > > I proposed a patch to migrate PPC off the old patterns, but have forgotten to > ping it recently - last at > https://gcc.gnu.org/ml/gcc-patches/2014-12/msg01024.html ... (ping?!) > Hi Alan, Thanks for this patch. I see that you

Re: [PATCH, rs6000] Add expansions for min/max vector reductions

2015-09-16 Thread Bill Schmidt
On Wed, 2015-09-16 at 16:29 +0100, Alan Lawrence wrote: > On 16/09/15 15:28, Bill Schmidt wrote: > > 2015-09-16 Bill Schmidt > > > > * config/rs6000/altivec.md (UNSPEC_REDUC_SMAX, UNSPEC_REDUC_SMIN, > > UNSPEC_REDUC_UMAX, UNSPEC_REDUC_UMIN,

Re: [PATCH, rs6000] Add expansions for min/max vector reductions

2015-09-16 Thread Bill Schmidt
On Wed, 2015-09-16 at 19:16 +0100, Alan Lawrence wrote: > On 16/09/15 17:19, Bill Schmidt wrote: > > On Wed, 2015-09-16 at 16:29 +0100, Alan Lawrence wrote: > >> > >> I proposed a patch to migrate PPC off the old patterns, but have forgotten > >> to > >> ping it recently - last at > >>

Re: [PATCH, rs6000] Add expansions for min/max vector reductions

2015-09-16 Thread Alan Lawrence
On 16/09/15 17:19, Bill Schmidt wrote: On Wed, 2015-09-16 at 16:29 +0100, Alan Lawrence wrote: I proposed a patch to migrate PPC off the old patterns, but have forgotten to ping it recently - last at https://gcc.gnu.org/ml/gcc-patches/2014-12/msg01024.html ... (ping?!) Hi Alan, Thanks for

Re: [PATCH, rs6000] Add expansions for min/max vector reductions

2015-09-16 Thread Bill Schmidt
On Wed, 2015-09-16 at 18:03 +0100, Alan Lawrence wrote: > On 16/09/15 17:10, Bill Schmidt wrote: > > > > On Wed, 2015-09-16 at 16:29 +0100, Alan Lawrence wrote: > >> On 16/09/15 15:28, Bill Schmidt wrote: > >>> 2015-09-16 Bill Schmidt > >>> > >>> *