On June 26, 2019 10:17:26 AM GMT+02:00, Uros Bizjak <ubiz...@gmail.com> 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 conversion and produces: > >foo: > movq (%rdi), %xmm1 > movq (%rsi), %xmm0 > paddb %xmm1, %xmm0 > movq %xmm0, (%rdi) > ret > >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" 2 > >For some reason, the compiler decides to vectorize with 8-byte >vectors, resulting in: > >missed: not vectorized: relevant stmt not supported: _8 = (short >unsigned int) _4; >missed: bad operation or unsupported loop bound. >missed: couldn't vectorize loop > >However, the unpatched compiler is able to vectorize loop using >16-byte vectors. It looks that the compiler should re-run >vectorization with wider vectors, if vectorization with narrower >vectors fails. Jakub, Richard, do you have any insight in this issue?
Double check the ordering of the vector size pushes - it should already iterate but first successful wins. Richard. >2019-06-26 Uroš Bizjak <ubiz...@gmail.com> > > * config/i386/i386.c (ix86_autovectorize_vector_sizes): > Autovectorize 8-byte vectors for TARGET_MMX_WITH_SSE. > >testsuite/ChangeLog: > >2019-06-26 Uroš Bizjak <ubiz...@gmail.com> > > * lib/target-supports.exp (available_vector_sizes) > <[istarget i?86-*-*] || [istarget x86_64-*-*]>: Add > 64-bit vectors for !ia32. > >The patch was bootstrapped and regression tested on x86_64-linux-gnu >{,-m32}. > >Uros.