This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH, i386] Avoid fixed 512-bit vector size in constant set for Intel AVX512 configuration


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.Shalnov@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.Shalnov@intel.com>

	* gcc.target/i386/avx512f-constant-set.c: New test.

Sergey

Attachment: 0001-Adjust-vector-length-usage-in-mov-mode-_internal.patch
Description: 0001-Adjust-vector-length-usage-in-mov-mode-_internal.patch


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]