Re: How to force gcc to vectorize the loop with particular vectorization width

2017-10-21 Thread Richard Biener
On October 21, 2017 9:50:13 PM GMT+02:00, Denis Bakhvalov wrote: >Hello Richard, >Thank you. I achieved vectorization with vf = 16, using >#pragma GCC optimize ("no-unroll-loops") >__attribute__ ((__target__ ("sse4.2"))) >and options -march=core-avx2 -mprefer-avx-128 > >But now I have a question:

Re: How to force gcc to vectorize the loop with particular vectorization width

2017-10-21 Thread Denis Bakhvalov
Hello Richard, Thank you. I achieved vectorization with vf = 16, using #pragma GCC optimize ("no-unroll-loops") __attribute__ ((__target__ ("sse4.2"))) and options -march=core-avx2 -mprefer-avx-128 But now I have a question: Is it possible in gcc to have vectorization with vf < 16? On 20/10/2017,

Re: How to force gcc to vectorize the loop with particular vectorization width

2017-10-20 Thread Richard Biener
On Fri, Oct 20, 2017 at 12:13 PM, Denis Bakhvalov wrote: > Thank you for the reply! > > Regarding last part of your message, this is also what clang will do > when you are passing vf of 4 (with the pragma from my first message) > for the loop operating on chars plus using SSE2. It will do meaningf

Re: How to force gcc to vectorize the loop with particular vectorization width

2017-10-20 Thread Denis Bakhvalov
Thank you for the reply! Regarding last part of your message, this is also what clang will do when you are passing vf of 4 (with the pragma from my first message) for the loop operating on chars plus using SSE2. It will do meaningful work only for 4 chars per iteration (a[0], zero, zero, zero, a[1

Re: How to force gcc to vectorize the loop with particular vectorization width

2017-10-19 Thread Jakub Jelinek
On Thu, Oct 19, 2017 at 10:38:28AM +0200, Richard Biener wrote: > On Thu, Oct 19, 2017 at 9:22 AM, Denis Bakhvalov wrote: > > Hello! > > > > I have a hot inner loop which was vectorized by gcc, but I also want > > compiler to unroll this loop by some factor. > > It can be controled in clang with t

Re: How to force gcc to vectorize the loop with particular vectorization width

2017-10-19 Thread Richard Biener
On Thu, Oct 19, 2017 at 9:22 AM, Denis Bakhvalov wrote: > Hello! > > I have a hot inner loop which was vectorized by gcc, but I also want > compiler to unroll this loop by some factor. > It can be controled in clang with this pragma: > #pragma clang loop vectorize(enable) vectorize_width(8) > Plea