Re: [PATCH] [PR target/97194] [AVX2] Support variable index vec_set.

2020-11-25 Thread Hongtao Liu via Gcc-patches
Thanks for the review. BTW, the patch is already installed because uros helped to review this patch in another thread https://gcc.gnu.org/pipermail/gcc-patches/2020-November/558682.html On Thu, Nov 26, 2020 at 3:15 AM Jeff Law wrote: > > > > On 11/11/20 1:03 AM, Hongtao Liu via Gcc-patches

Re: [PATCH] [PR target/97194] [AVX2] Support variable index vec_set.

2020-11-25 Thread Jeff Law via Gcc-patches
On 11/11/20 1:03 AM, Hongtao Liu via Gcc-patches wrote: > > > > vec_set_rebaserebase_onr11-4901.patch > > From c9d684c37b5f79f68f938f39eeb9e7989b10302d Mon Sep 17 00:00:00 2001 > From: liuhongt > Date: Mon, 19 Oct 2020 16:04:39 +0800 > Subject: [PATCH] Support variable index vec_set. > >

Re: [PATCH] [PR target/97194] [AVX2] Support variable index vec_set.

2020-11-19 Thread Richard Sandiford via Gcc-patches
Sorry for the late reply. I somehow managed to miss this thread until now despite being cc:ed. > > I'm not sure what best to do here, as said accepting "any" (integer) mode as > > input is desirable (SImode, DImode but eventually also smaller modes). How > > that can be best achieved I don't

Re: [PATCH] [PR target/97194] [AVX2] Support variable index vec_set.

2020-11-16 Thread Uros Bizjak via Gcc-patches
On Thu, Nov 12, 2020 at 2:59 PM Richard Biener wrote: > I'm not sure what best to do here, as said accepting "any" (integer) mode as > input is desirable (SImode, DImode but eventually also smaller modes). How > that can be best achieved I don't know. FTR, attached patch *should* allow s390

Re: [PATCH] [PR target/97194] [AVX2] Support variable index vec_set.

2020-11-16 Thread Uros Bizjak via Gcc-patches
On Thu, Nov 12, 2020 at 10:10 AM Hongtao Liu wrote: > > On Thu, Nov 12, 2020 at 4:21 PM Uros Bizjak wrote: > > > > On Thu, Nov 12, 2020 at 3:04 AM Hongtao Liu wrote: > > > > > > > gcc/ChangeLog: > > > > > > > > > > PR target/97194 > > > > > * config/i386/i386-expand.c

Re: [PATCH] [PR target/97194] [AVX2] Support variable index vec_set.

2020-11-12 Thread Uros Bizjak via Gcc-patches
On Thu, Nov 12, 2020 at 7:26 PM Uros Bizjak wrote: > > On Thu, Nov 12, 2020 at 6:51 PM Uros Bizjak wrote: > > > > > > Yes, removed 'code' and value_mode by checking VECTOR_MODE_P and use > > > > > GET_MODE_INNER > > > > > for value_mode. ".md expanders" shall support for integer constants > >

Re: [PATCH] [PR target/97194] [AVX2] Support variable index vec_set.

2020-11-12 Thread Uros Bizjak via Gcc-patches
On Thu, Nov 12, 2020 at 6:51 PM Uros Bizjak wrote: > > > > Yes, removed 'code' and value_mode by checking VECTOR_MODE_P and use > > > > GET_MODE_INNER > > > > for value_mode. ".md expanders" shall support for integer constants > > > > index mode, but > > > > I guess they shouldn't be expanded

Re: [PATCH] [PR target/97194] [AVX2] Support variable index vec_set.

2020-11-12 Thread Uros Bizjak via Gcc-patches
On Thu, Nov 12, 2020 at 2:59 PM Richard Biener wrote: > > > > > > > > gcc/ChangeLog: > > > > > > > > > > > > > > > > PR target/97194 > > > > > > > > * config/i386/i386-expand.c (ix86_expand_vector_set_var): New > > > > > > > > function. > > > > > > > > * config/i386/i386-protos.h

Re: [PATCH] [PR target/97194] [AVX2] Support variable index vec_set.

2020-11-12 Thread Richard Biener via Gcc-patches
On Thu, Nov 12, 2020 at 10:23 AM Hongtao Liu wrote: > > On Thu, Nov 12, 2020 at 5:15 PM Hongtao Liu wrote: > > > > On Thu, Nov 12, 2020 at 5:12 PM Hongtao Liu wrote: > > > > > > On Thu, Nov 12, 2020 at 4:21 PM Uros Bizjak wrote: > > > > > > > > On Thu, Nov 12, 2020 at 3:04 AM Hongtao Liu

Re: [PATCH] [PR target/97194] [AVX2] Support variable index vec_set.

2020-11-12 Thread Hongtao Liu via Gcc-patches
On Thu, Nov 12, 2020 at 5:15 PM Hongtao Liu wrote: > > On Thu, Nov 12, 2020 at 5:12 PM Hongtao Liu wrote: > > > > On Thu, Nov 12, 2020 at 4:21 PM Uros Bizjak wrote: > > > > > > On Thu, Nov 12, 2020 at 3:04 AM Hongtao Liu wrote: > > > > > > > > > gcc/ChangeLog: > > > > > > > > > > > > PR

Re: [PATCH] [PR target/97194] [AVX2] Support variable index vec_set.

2020-11-12 Thread Hongtao Liu via Gcc-patches
On Thu, Nov 12, 2020 at 5:12 PM Hongtao Liu wrote: > > On Thu, Nov 12, 2020 at 4:21 PM Uros Bizjak wrote: > > > > On Thu, Nov 12, 2020 at 3:04 AM Hongtao Liu wrote: > > > > > > > gcc/ChangeLog: > > > > > > > > > > PR target/97194 > > > > > * config/i386/i386-expand.c

Re: [PATCH] [PR target/97194] [AVX2] Support variable index vec_set.

2020-11-12 Thread Hongtao Liu via Gcc-patches
On Thu, Nov 12, 2020 at 4:21 PM Uros Bizjak wrote: > > On Thu, Nov 12, 2020 at 3:04 AM Hongtao Liu wrote: > > > > > gcc/ChangeLog: > > > > > > > > PR target/97194 > > > > * config/i386/i386-expand.c (ix86_expand_vector_set_var): New function. > > > > * config/i386/i386-protos.h

Re: [PATCH] [PR target/97194] [AVX2] Support variable index vec_set.

2020-11-12 Thread Uros Bizjak via Gcc-patches
On Thu, Nov 12, 2020 at 3:04 AM Hongtao Liu wrote: > > > gcc/ChangeLog: > > > > > > PR target/97194 > > > * config/i386/i386-expand.c (ix86_expand_vector_set_var): New function. > > > * config/i386/i386-protos.h (ix86_expand_vector_set_var): New Decl. > > > * config/i386/predicates.md

Re: [PATCH] [PR target/97194] [AVX2] Support variable index vec_set.

2020-11-11 Thread Hongtao Liu via Gcc-patches
On Wed, Nov 11, 2020 at 4:45 PM Uros Bizjak wrote: > > > gcc/ChangeLog: > > > > PR target/97194 > > * config/i386/i386-expand.c (ix86_expand_vector_set_var): New function. > > * config/i386/i386-protos.h (ix86_expand_vector_set_var): New Decl. > > * config/i386/predicates.md (vec_setm_operand):

Re: [PATCH] [PR target/97194] [AVX2] Support variable index vec_set.

2020-11-11 Thread Uros Bizjak via Gcc-patches
> gcc/ChangeLog: > > PR target/97194 > * config/i386/i386-expand.c (ix86_expand_vector_set_var): New function. > * config/i386/i386-protos.h (ix86_expand_vector_set_var): New Decl. > * config/i386/predicates.md (vec_setm_operand): New predicate, > true for const_int_operand or register_operand

Re: [PATCH] [PR target/97194] [AVX2] Support variable index vec_set.

2020-11-11 Thread Hongtao Liu via Gcc-patches
ping ^3 Rebase patch on latest trunk. On Tue, Oct 27, 2020 at 3:51 PM Hongtao Liu wrote: > > ping^1 > > On Tue, Oct 20, 2020 at 3:36 PM Richard Biener > wrote: > > > > On Tue, Oct 20, 2020 at 4:35 AM Hongtao Liu wrote: > > > > > > On Mon, Oct 19, 2020 at 5:55 PM Richard Biener > > > wrote: >

Re: [PATCH] [PR target/97194] [AVX2] Support variable index vec_set.

2020-10-27 Thread Hongtao Liu via Gcc-patches
ping^1 On Tue, Oct 20, 2020 at 3:36 PM Richard Biener wrote: > > On Tue, Oct 20, 2020 at 4:35 AM Hongtao Liu wrote: > > > > On Mon, Oct 19, 2020 at 5:55 PM Richard Biener > > wrote: > > > > > > On Mon, Oct 19, 2020 at 11:37 AM Hongtao Liu wrote: > > > > > > > > On Mon, Oct 19, 2020 at 5:07 PM

Re: [PATCH] [PR target/97194] [AVX2] Support variable index vec_set.

2020-10-20 Thread Richard Biener via Gcc-patches
On Tue, Oct 20, 2020 at 4:35 AM Hongtao Liu wrote: > > On Mon, Oct 19, 2020 at 5:55 PM Richard Biener > wrote: > > > > On Mon, Oct 19, 2020 at 11:37 AM Hongtao Liu wrote: > > > > > > On Mon, Oct 19, 2020 at 5:07 PM Richard Biener > > > wrote: > > > > > > > > On Mon, Oct 19, 2020 at 10:21 AM

Re: [PATCH] [PR target/97194] [AVX2] Support variable index vec_set.

2020-10-19 Thread Hongtao Liu via Gcc-patches
On Mon, Oct 19, 2020 at 5:55 PM Richard Biener wrote: > > On Mon, Oct 19, 2020 at 11:37 AM Hongtao Liu wrote: > > > > On Mon, Oct 19, 2020 at 5:07 PM Richard Biener > > wrote: > > > > > > On Mon, Oct 19, 2020 at 10:21 AM Hongtao Liu wrote: > > > > > > > > Hi: > > > > It's implemented as

Re: [PATCH] [PR target/97194] [AVX2] Support variable index vec_set.

2020-10-19 Thread Richard Biener via Gcc-patches
On Mon, Oct 19, 2020 at 11:37 AM Hongtao Liu wrote: > > On Mon, Oct 19, 2020 at 5:07 PM Richard Biener > wrote: > > > > On Mon, Oct 19, 2020 at 10:21 AM Hongtao Liu wrote: > > > > > > Hi: > > > It's implemented as below: > > > V setg (V v, int idx, T val) > > > > > > { > > > V idxv =

Re: [PATCH] [PR target/97194] [AVX2] Support variable index vec_set.

2020-10-19 Thread Hongtao Liu via Gcc-patches
On Mon, Oct 19, 2020 at 5:07 PM Richard Biener wrote: > > On Mon, Oct 19, 2020 at 10:21 AM Hongtao Liu wrote: > > > > Hi: > > It's implemented as below: > > V setg (V v, int idx, T val) > > > > { > > V idxv = (V){idx, idx, idx, idx, idx, idx, idx, idx}; > > V valv = (V){val, val, val, val,

Re: [PATCH] [PR target/97194] [AVX2] Support variable index vec_set.

2020-10-19 Thread Richard Biener via Gcc-patches
On Mon, Oct 19, 2020 at 10:21 AM Hongtao Liu wrote: > > Hi: > It's implemented as below: > V setg (V v, int idx, T val) > > { > V idxv = (V){idx, idx, idx, idx, idx, idx, idx, idx}; > V valv = (V){val, val, val, val, val, val, val, val}; > V mask = ((V){0, 1, 2, 3, 4, 5, 6, 7} == idxv); >

[PATCH] [PR target/97194] [AVX2] Support variable index vec_set.

2020-10-19 Thread Hongtao Liu via Gcc-patches
Hi: It's implemented as below: V setg (V v, int idx, T val) { V idxv = (V){idx, idx, idx, idx, idx, idx, idx, idx}; V valv = (V){val, val, val, val, val, val, val, val}; V mask = ((V){0, 1, 2, 3, 4, 5, 6, 7} == idxv); v = (v & ~mask) | (valv & mask); return v; } Bootstrap is fine,