Re: [PATCH] rs6000: Expand vec_insert in expander instead of gimple [PR79251]

2020-09-04 Thread Segher Boessenkool
Hi! On Fri, Sep 04, 2020 at 05:18:49PM +0800, luoxhu wrote: > On 2020/9/4 15:23, Richard Biener wrote: > > On Fri, Sep 4, 2020 at 9:19 AM Richard Biener > > wrote: > >> On Fri, Sep 4, 2020 at 8:38 AM luoxhu wrote: > >>> On 2020/9/4 14:16, luoxhu via Gcc-patches wrote: > Another problem is

Re: [PATCH] rs6000: Expand vec_insert in expander instead of gimple [PR79251]

2020-09-04 Thread luoxhu via Gcc-patches
On 2020/9/4 15:23, Richard Biener wrote: > On Fri, Sep 4, 2020 at 9:19 AM Richard Biener > wrote: >> >> On Fri, Sep 4, 2020 at 8:38 AM luoxhu wrote: >>> >>> >>> >>> On 2020/9/4 14:16, luoxhu via Gcc-patches wrote: Hi, Yes, I checked and found that both vec_set and

Re: [PATCH] rs6000: Expand vec_insert in expander instead of gimple [PR79251]

2020-09-04 Thread Richard Biener via Gcc-patches
On Fri, Sep 4, 2020 at 9:19 AM Richard Biener wrote: > > On Fri, Sep 4, 2020 at 8:38 AM luoxhu wrote: > > > > > > > > On 2020/9/4 14:16, luoxhu via Gcc-patches wrote: > > > Hi, > > > > > > > > > Yes, I checked and found that both vec_set and vec_extract doesn't support > > > variable index for

Re: [PATCH] rs6000: Expand vec_insert in expander instead of gimple [PR79251]

2020-09-04 Thread Richard Biener via Gcc-patches
On Fri, Sep 4, 2020 at 8:38 AM luoxhu wrote: > > > > On 2020/9/4 14:16, luoxhu via Gcc-patches wrote: > > Hi, > > > > > > Yes, I checked and found that both vec_set and vec_extract doesn't support > > variable index for most targets, store_bit_field_1 and extract_bit_field_1 > > would only

Re: [PATCH] rs6000: Expand vec_insert in expander instead of gimple [PR79251]

2020-09-04 Thread luoxhu via Gcc-patches
On 2020/9/4 14:16, luoxhu via Gcc-patches wrote: Hi, Yes, I checked and found that both vec_set and vec_extract doesn't support variable index for most targets, store_bit_field_1 and extract_bit_field_1 would only consider use optabs when index is integer value. Anyway, it shouldn't be

Re: [PATCH] rs6000: Expand vec_insert in expander instead of gimple [PR79251]

2020-09-04 Thread luoxhu via Gcc-patches
Hi, On 2020/9/3 18:29, Richard Biener wrote: > On Thu, Sep 3, 2020 at 11:20 AM luoxhu wrote: >> >> >> >> On 2020/9/2 17:30, Richard Biener wrote: so maybe bypass convert_vector_to_array_for_subscript for special circumstance like "i = v[n%4]" or "v[n&3]=i" to generate vec_extract

Re: [PATCH] rs6000: Expand vec_insert in expander instead of gimple [PR79251]

2020-09-03 Thread Richard Biener via Gcc-patches
On Thu, Sep 3, 2020 at 11:20 AM luoxhu wrote: > > > > On 2020/9/2 17:30, Richard Biener wrote: > >> so maybe bypass convert_vector_to_array_for_subscript for special > >> circumstance > >> like "i = v[n%4]" or "v[n&3]=i" to generate vec_extract or vec_insert > >> builtin > >> call a relative

Re: [PATCH] rs6000: Expand vec_insert in expander instead of gimple [PR79251]

2020-09-03 Thread luoxhu via Gcc-patches
On 2020/9/2 17:30, Richard Biener wrote: >> so maybe bypass convert_vector_to_array_for_subscript for special >> circumstance >> like "i = v[n%4]" or "v[n&3]=i" to generate vec_extract or vec_insert builtin >> call a relative simpler method? > I think you have it backward. You need to work

Re: [PATCH] rs6000: Expand vec_insert in expander instead of gimple [PR79251]

2020-09-02 Thread Richard Biener via Gcc-patches
On Wed, Sep 2, 2020 at 11:26 AM luoxhu wrote: > > Hi, > > On 2020/9/1 21:07, Richard Biener wrote: > > On Tue, Sep 1, 2020 at 10:11 AM luoxhu via Gcc-patches > > wrote: > >> > >> Hi, > >> > >> On 2020/9/1 01:04, Segher Boessenkool wrote: > >>> Hi! > >>> > >>> On Mon, Aug 31, 2020 at 04:06:47AM

Re: [PATCH] rs6000: Expand vec_insert in expander instead of gimple [PR79251]

2020-09-02 Thread luoxhu via Gcc-patches
Hi, On 2020/9/1 21:07, Richard Biener wrote: > On Tue, Sep 1, 2020 at 10:11 AM luoxhu via Gcc-patches > wrote: >> >> Hi, >> >> On 2020/9/1 01:04, Segher Boessenkool wrote: >>> Hi! >>> >>> On Mon, Aug 31, 2020 at 04:06:47AM -0500, Xiong Hu Luo wrote: vec_insert accepts 3 arguments, arg0 is

Re: [PATCH] rs6000: Expand vec_insert in expander instead of gimple [PR79251]

2020-09-01 Thread Segher Boessenkool
On Tue, Sep 01, 2020 at 04:09:53PM +0800, luoxhu wrote: > On 2020/9/1 01:04, Segher Boessenkool wrote: > > For v a V4SI, x a SI, j some int, what do we generate for > >v[j&3] = x; > > ? > > This should be exactly the same as we generate for > >vec_insert(x, v, j); > > (the builtin does a

Re: [PATCH] rs6000: Expand vec_insert in expander instead of gimple [PR79251]

2020-09-01 Thread Richard Biener via Gcc-patches
On Tue, Sep 1, 2020 at 10:11 AM luoxhu via Gcc-patches wrote: > > Hi, > > On 2020/9/1 01:04, Segher Boessenkool wrote: > > Hi! > > > > On Mon, Aug 31, 2020 at 04:06:47AM -0500, Xiong Hu Luo wrote: > >> vec_insert accepts 3 arguments, arg0 is input vector, arg1 is the value > >> to be insert, arg2

Re: [PATCH] rs6000: Expand vec_insert in expander instead of gimple [PR79251]

2020-09-01 Thread luoxhu via Gcc-patches
Hi, On 2020/9/1 00:47, will schmidt wrote: >> + tmode = TYPE_MODE (TREE_TYPE (arg0)); >> + mode1 = TYPE_MODE (TREE_TYPE (TREE_TYPE (arg0))); >> + mode2 = TYPE_MODE ((TREE_TYPE (arg2))); >> + gcc_assert (VECTOR_MODE_P (tmode)); >> + >> + op0 = expand_expr (arg0, NULL_RTX, tmode,

Re: [PATCH] rs6000: Expand vec_insert in expander instead of gimple [PR79251]

2020-09-01 Thread luoxhu via Gcc-patches
Hi, On 2020/9/1 01:04, Segher Boessenkool wrote: > Hi! > > On Mon, Aug 31, 2020 at 04:06:47AM -0500, Xiong Hu Luo wrote: >> vec_insert accepts 3 arguments, arg0 is input vector, arg1 is the value >> to be insert, arg2 is the place to insert arg1 to arg0. This patch adds >>

Re: [PATCH] rs6000: Expand vec_insert in expander instead of gimple [PR79251]

2020-08-31 Thread Segher Boessenkool
Hi! On Mon, Aug 31, 2020 at 04:06:47AM -0500, Xiong Hu Luo wrote: > vec_insert accepts 3 arguments, arg0 is input vector, arg1 is the value > to be insert, arg2 is the place to insert arg1 to arg0. This patch adds > __builtin_vec_insert_v4si[v4sf,v2di,v2df,v8hi,v16qi] for vec_insert to > not

Re: [PATCH] rs6000: Expand vec_insert in expander instead of gimple [PR79251]

2020-08-31 Thread will schmidt via Gcc-patches
On Mon, 2020-08-31 at 04:06 -0500, Xiong Hu Luo via Gcc-patches wrote: > vec_insert accepts 3 arguments, arg0 is input vector, arg1 is the value > to be insert, arg2 is the place to insert arg1 to arg0. This patch adds > __builtin_vec_insert_v4si[v4sf,v2di,v2df,v8hi,v16qi] for vec_insert to > not

Re: [PATCH] rs6000: Expand vec_insert in expander instead of gimple [PR79251]

2020-08-31 Thread Richard Biener via Gcc-patches
On Mon, Aug 31, 2020 at 11:09 AM Xiong Hu Luo via Gcc-patches wrote: > > vec_insert accepts 3 arguments, arg0 is input vector, arg1 is the value > to be insert, arg2 is the place to insert arg1 to arg0. This patch adds > __builtin_vec_insert_v4si[v4sf,v2di,v2df,v8hi,v16qi] for vec_insert to >

[PATCH] rs6000: Expand vec_insert in expander instead of gimple [PR79251]

2020-08-31 Thread Xiong Hu Luo via Gcc-patches
vec_insert accepts 3 arguments, arg0 is input vector, arg1 is the value to be insert, arg2 is the place to insert arg1 to arg0. This patch adds __builtin_vec_insert_v4si[v4sf,v2di,v2df,v8hi,v16qi] for vec_insert to not expand too early in gimple stage if arg2 is variable, to avoid generate store