Re: [RFC PATCH, i386]: Autovectorize 8-byte vectors

2019-06-27 Thread Jeff Law
On 6/27/19 9:34 AM, Jakub Jelinek wrote: > On Thu, Jun 27, 2019 at 09:24:58AM -0600, Jeff Law wrote: >> On 6/27/19 12:05 AM, Jakub Jelinek wrote: >>> On Wed, Jun 26, 2019 at 12:19:28PM +0200, Uros Bizjak wrote: Yes, the patch works OK. I'll regression test it and push it later today. >>> >>> I

Re: [RFC PATCH, i386]: Autovectorize 8-byte vectors

2019-06-27 Thread Jakub Jelinek
On Thu, Jun 27, 2019 at 09:24:58AM -0600, Jeff Law wrote: > On 6/27/19 12:05 AM, Jakub Jelinek wrote: > > On Wed, Jun 26, 2019 at 12:19:28PM +0200, Uros Bizjak wrote: > >> Yes, the patch works OK. I'll regression test it and push it later today. > > > > I think it caused > > +FAIL: gcc.dg/tree-ssa

Re: [RFC PATCH, i386]: Autovectorize 8-byte vectors

2019-06-27 Thread Jeff Law
On 6/27/19 12:05 AM, Jakub Jelinek wrote: > On Wed, Jun 26, 2019 at 12:19:28PM +0200, Uros Bizjak wrote: >> Yes, the patch works OK. I'll regression test it and push it later today. > > I think it caused > +FAIL: gcc.dg/tree-ssa/pr84512.c scan-tree-dump optimized "return 285;" > which admittedly a

Re: [RFC PATCH, i386]: Autovectorize 8-byte vectors

2019-06-27 Thread Richard Biener
On Thu, 27 Jun 2019, Uros Bizjak wrote: > On Thu, Jun 27, 2019 at 8:05 AM Jakub Jelinek wrote: > > > > On Wed, Jun 26, 2019 at 12:19:28PM +0200, Uros Bizjak wrote: > > > Yes, the patch works OK. I'll regression test it and push it later today. > > > > I think it caused > > +FAIL: gcc.dg/tree-ssa/

Re: [RFC PATCH, i386]: Autovectorize 8-byte vectors

2019-06-26 Thread Uros Bizjak
On Thu, Jun 27, 2019 at 8:05 AM Jakub Jelinek wrote: > > On Wed, Jun 26, 2019 at 12:19:28PM +0200, Uros Bizjak wrote: > > Yes, the patch works OK. I'll regression test it and push it later today. > > I think it caused > +FAIL: gcc.dg/tree-ssa/pr84512.c scan-tree-dump optimized "return 285;" > whic

Re: [RFC PATCH, i386]: Autovectorize 8-byte vectors

2019-06-26 Thread Jakub Jelinek
On Wed, Jun 26, 2019 at 12:19:28PM +0200, Uros Bizjak wrote: > Yes, the patch works OK. I'll regression test it and push it later today. I think it caused +FAIL: gcc.dg/tree-ssa/pr84512.c scan-tree-dump optimized "return 285;" which admittedly already is xfailed on various targets. We now newly ve

Re: [RFC PATCH, i386]: Autovectorize 8-byte vectors

2019-06-26 Thread Jakub Jelinek
On Wed, Jun 26, 2019 at 12:19:28PM +0200, Uros Bizjak wrote: > > The patch isn't correct if TARGET_MMX_WITH_SSE, but not TARGET_AVX, because > > in that case it will push only that 8 and nothing else, while you really > > want to have 16 and 8 in that order, so that it tries to vectorize first > >

Re: [RFC PATCH, i386]: Autovectorize 8-byte vectors

2019-06-26 Thread Uros Bizjak
On Wed, Jun 26, 2019 at 10:47 AM Jakub Jelinek wrote: > > On Wed, Jun 26, 2019 at 10:17:26AM +0200, Uros Bizjak wrote: > > Please note that the patch regresses > > > > FAIL: gcc.target/i386/sse2-vect-simd-11.c scan-tree-dump-times vect > > "vectorized [1-3] loops" 2 > > FAIL: gcc.target/i386/sse2-

Re: [RFC PATCH, i386]: Autovectorize 8-byte vectors

2019-06-26 Thread Jakub Jelinek
On Wed, Jun 26, 2019 at 10:17:26AM +0200, Uros Bizjak wrote: > Please note that the patch regresses > > FAIL: gcc.target/i386/sse2-vect-simd-11.c scan-tree-dump-times vect > "vectorized [1-3] loops" 2 > FAIL: gcc.target/i386/sse2-vect-simd-15.c scan-tree-dump-times vect > "vectorized [1-3] loops"

Re: [RFC PATCH, i386]: Autovectorize 8-byte vectors

2019-06-26 Thread Uros Bizjak
On Wed, Jun 26, 2019 at 10:36 AM Richard Biener wrote: > > On June 26, 2019 10:25:44 AM GMT+02:00, Uros Bizjak wrote: > >On Wed, Jun 26, 2019 at 10:17 AM Uros Bizjak wrote: > >> > >> Now that TARGET_MMX_WITH_SSE is implemented, the compiler should be > >> able to auto-vectorize: > > > >On a rela

Re: [RFC PATCH, i386]: Autovectorize 8-byte vectors

2019-06-26 Thread Richard Biener
On June 26, 2019 10:25:44 AM GMT+02:00, Uros Bizjak wrote: >On Wed, Jun 26, 2019 at 10:17 AM Uros Bizjak wrote: >> >> Now that TARGET_MMX_WITH_SSE is implemented, the compiler should be >> able to auto-vectorize: > >On a related note, following slightly changed testcase: > >void >foo (char *restr

Re: [RFC PATCH, i386]: Autovectorize 8-byte vectors

2019-06-26 Thread Richard Biener
On June 26, 2019 10:17:26 AM GMT+02:00, Uros Bizjak wrote: >Now that TARGET_MMX_WITH_SSE is implemented, the compiler should be >able to auto-vectorize: > >void >foo (char *restrict r, char *restrict a) >{ > for (int i = 0; i < 8; i++) >r[i] += a[i]; >} > >Attached patch enables the conversio

Re: [RFC PATCH, i386]: Autovectorize 8-byte vectors

2019-06-26 Thread Uros Bizjak
On Wed, Jun 26, 2019 at 10:17 AM Uros Bizjak wrote: > > Now that TARGET_MMX_WITH_SSE is implemented, the compiler should be > able to auto-vectorize: On a related note, following slightly changed testcase: void foo (char *restrict r, char *restrict a) { for (int i = 0; i < 24; i++) r[i] +=

[RFC PATCH, i386]: Autovectorize 8-byte vectors

2019-06-26 Thread Uros Bizjak
Now that TARGET_MMX_WITH_SSE is implemented, the compiler should be able to auto-vectorize: void foo (char *restrict r, char *restrict a) { for (int i = 0; i < 8; i++) r[i] += a[i]; } Attached patch enables the conversion and produces: foo: movq(%rdi), %xmm1 movq(%r