On Thu, Sep 21, 2017 at 3:41 PM, Shalnov, Sergey <sergey.shal...@intel.com> wrote: > Hi, > GCC uses full 512-bit register to keep the constant. This constant uses in > the code further but with 128-bit vector length. > The patch avoid fixed large vector length usage. > > For the simple code: > void my_test(short *table) > { > for (int i = 0; i < 128; ++i) { > table[i] = -1; > } > } > > It generates: > vpternlogd $0xFF, %zmm0, %zmm0, %zmm0 > vmovups %xmm0, (%rdi) > vmovups %xmm0, 16(%rdi) > vmovups %xmm0, 32(%rdi) > ...etc.. > > The patched GCC generates: > vpcmpeqd %xmm0,%xmm0,%xmm0 > vmovups %xmm0,(%rdi) > vmovups %xmm0,0x10(%rdi) > vmovups %xmm0,0x20(%rdi) > ...etc.. > > > gcc/ChangeLog: > > 2017-09-21 Sergey Shalnov <sergey.shal...@intel.com> > > * config/i386/sse.md: The vector legister length should be the same > as it used. Avoid the largest fixed vector length. > > gcc/testsuite/ChangeLog: > > 2017-09-21 Sergey Shalnov <sergey.shal...@intel.com> > > * gcc.target/i386/avx512f-constant-set.c: New test.
The patch is OK. The ChangeLog is not. Uros.