This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, i386] Avoid fixed 512-bit vector size in constant set for Intel AVX512 configuration
- From: Uros Bizjak <ubizjak at gmail dot com>
- To: "Shalnov, Sergey" <sergey dot shalnov at intel dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, "kirill dot yukhin at gmail dot com" <kirill dot yukhin at gmail dot com>, "Koval, Julia" <julia dot koval at intel dot com>, "Senkevich, Andrew" <andrew dot senkevich at intel dot com>, "Ivchenko, Alexander" <alexander dot ivchenko at intel dot com>
- Date: Thu, 21 Sep 2017 15:54:08 +0200
- Subject: Re: [PATCH, i386] Avoid fixed 512-bit vector size in constant set for Intel AVX512 configuration
- Authentication-results: sourceware.org; auth=none
- References: <71475DE127B5E94A8E189586234C088812274326@irsmsx105.ger.corp.intel.com>
On Thu, Sep 21, 2017 at 3:41 PM, Shalnov, Sergey
<sergey.shalnov@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.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.
The patch is OK. The ChangeLog is not.
Uros.