Re: [PATCH] move x86 to use gather/scatter internal functions

2021-08-19 Thread Richard Biener via Gcc-patches
On Thu, 19 Aug 2021, Richard Sandiford wrote: > Richard Biener writes: > > On Wed, 18 Aug 2021, Richard Sandiford wrote: > >> I think it would be OK/sensible to use the larger of the index or > >> result vectors to determine the mask, if that helps. There just > >> wasn't any need to make a dist

Re: [PATCH] move x86 to use gather/scatter internal functions

2021-08-19 Thread Richard Sandiford via Gcc-patches
Richard Biener writes: > On Wed, 18 Aug 2021, Richard Sandiford wrote: >> I think it would be OK/sensible to use the larger of the index or >> result vectors to determine the mask, if that helps. There just >> wasn't any need to make a distinction for SVE, since there the >> mask type is determin

Re: [PATCH] move x86 to use gather/scatter internal functions

2021-08-19 Thread Richard Biener via Gcc-patches
On Wed, 18 Aug 2021, Richard Sandiford wrote: > Richard Biener writes: > > On Wed, 18 Aug 2021, Hongtao Liu wrote: > > > >> On Wed, Aug 18, 2021 at 7:37 PM Hongtao Liu wrote: > >> > > >> > On Wed, Aug 18, 2021 at 7:30 PM Hongtao Liu wrote: > >> > > > >> > > On Wed, Aug 18, 2021 at 6:28 PM Richa

Re: [PATCH] move x86 to use gather/scatter internal functions

2021-08-18 Thread Richard Sandiford via Gcc-patches
Richard Biener writes: > On Wed, 18 Aug 2021, Hongtao Liu wrote: > >> On Wed, Aug 18, 2021 at 7:37 PM Hongtao Liu wrote: >> > >> > On Wed, Aug 18, 2021 at 7:30 PM Hongtao Liu wrote: >> > > >> > > On Wed, Aug 18, 2021 at 6:28 PM Richard Biener wrote: >> > > > >> > > > On Wed, 18 Aug 2021, Richar

Re: [PATCH] move x86 to use gather/scatter internal functions

2021-08-18 Thread Richard Biener via Gcc-patches
On Wed, 18 Aug 2021, Hongtao Liu wrote: > On Wed, Aug 18, 2021 at 7:37 PM Hongtao Liu wrote: > > > > On Wed, Aug 18, 2021 at 7:30 PM Hongtao Liu wrote: > > > > > > On Wed, Aug 18, 2021 at 6:28 PM Richard Biener wrote: > > > > > > > > On Wed, 18 Aug 2021, Richard Biener wrote: > > > > > > > > >

Re: [PATCH] move x86 to use gather/scatter internal functions

2021-08-18 Thread Hongtao Liu via Gcc-patches
target = gen_reg_rtx (V4SFmode); > > emit_insn (gen_vec_extract_lo_v8sf (target, subtarget)); > > ---cut from i386-expand.c--- > > > > and do ugly things when expand builtin > > > > > From the ISA docs I conclude that vgatherqps is not supported for

Re: [PATCH] move x86 to use gather/scatter internal functions

2021-08-18 Thread Hongtao Liu via Gcc-patches
t; >(V2DF "V4SI") (V4DF "V4SI") (V8DF "V8SI") > > (V4SI "V4SI") (V8SI "V8SI") (V16SI "V16SI") > >(V4SF "V4SI") (V8SF "V8SI") (V16SF

Re: [PATCH] move x86 to use gather/scatter internal functions

2021-08-18 Thread Richard Biener via Gcc-patches
F "V8DI") (V16SF "V8DI")] Hum, it seems to be more complicated (or simpler). The gatherq instructions will always fill only half of the SFmode destination while the gatherd will only use half of the index vector for a DFmode destination. So we support mask_gather_load

Re: [PATCH] move x86 to use gather/scatter internal functions

2021-08-18 Thread Hongtao Liu via Gcc-patches
gatherdi" > [(parallel [(set (match_operand:VI48F 0 "register_operand") > (unspec:VI48F > > "supports" V16SI and V16SF gathers, leading to broken patterns? > > I can test if anything goes wrong fixing VEC_GATHER_IDXDI to > > (define

Re: [PATCH] move x86 to use gather/scatter internal functions

2021-08-18 Thread Richard Biener via Gcc-patches
nce > > AVX doesn't have scatter). > > > > Thanks, > > Richard. > > > > From 706d3ac96b384eaad249cc83ec542ec643e21a4c Mon Sep 17 00:00:00 2001 > > From: Richard Biener > > Date: Tue, 17 Aug 2021 15:14:38 +0200 > > Subject: [PATCH] move x86 to use gather/scatter internal

Re: [PATCH] move x86 to use gather/scatter internal functions

2021-08-18 Thread Richard Biener via Gcc-patches
ster_operand") (unspec:VI48F "supports" V16SI and V16SF gathers, leading to broken patterns? I can test if anything goes wrong fixing VEC_GATHER_IDXDI to (define_mode_attr VEC_GATHER_IDXDI [(V2DI "V2DI") (V4DI "V4DI") (V8

Re: [PATCH] move x86 to use gather/scatter internal functions

2021-08-18 Thread Hongtao Liu via Gcc-patches
43e21a4c Mon Sep 17 00:00:00 2001 > From: Richard Biener > Date: Tue, 17 Aug 2021 15:14:38 +0200 > Subject: [PATCH] move x86 to use gather/scatter internal functions > To: gcc-patches@gcc.gnu.org > > This moves the x86 backend to use standard pattern names for > mask_gather

Re: [PATCH] move x86 to use gather/scatter internal functions

2021-08-18 Thread Richard Biener via Gcc-patches
below? If not I'll do mask_scatter_store accordingly (that will be simpler since AVX doesn't have scatter). Thanks, Richard. >From 706d3ac96b384eaad249cc83ec542ec643e21a4c Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Tue, 17 Aug 2021 15:14:38 +0200 Subject: [PATCH] move x86 to

Re: [PATCH] move x86 to use gather/scatter internal functions

2021-08-18 Thread Richard Biener via Gcc-patches
On Wed, 18 Aug 2021, Hongtao Liu wrote: > On Wed, Aug 18, 2021 at 4:32 PM Richard Biener wrote: > > > > On Wed, 18 Aug 2021, Hongtao Liu wrote: > > > > > On Wed, Aug 18, 2021 at 11:24 AM Hongtao Liu wrote: > > > > > > > > On Tue, Aug 17, 2021 at 10:43 PM Richard Biener via Gcc-patches > > > > w

Re: [PATCH] move x86 to use gather/scatter internal functions

2021-08-18 Thread Hongtao Liu via Gcc-patches
On Wed, Aug 18, 2021 at 4:32 PM Richard Biener wrote: > > On Wed, 18 Aug 2021, Hongtao Liu wrote: > > > On Wed, Aug 18, 2021 at 11:24 AM Hongtao Liu wrote: > > > > > > On Tue, Aug 17, 2021 at 10:43 PM Richard Biener via Gcc-patches > > > wrote: > > > > > > > > On Tue, Aug 17, 2021 at 3:29 PM Ric

Re: [PATCH] move x86 to use gather/scatter internal functions

2021-08-18 Thread Richard Biener via Gcc-patches
On Wed, 18 Aug 2021, Hongtao Liu wrote: > On Wed, Aug 18, 2021 at 11:24 AM Hongtao Liu wrote: > > > > On Tue, Aug 17, 2021 at 10:43 PM Richard Biener via Gcc-patches > > wrote: > > > > > > On Tue, Aug 17, 2021 at 3:29 PM Richard Biener via Gcc-patches > > > wrote: > > > > > > > > This is an att

Re: [PATCH] move x86 to use gather/scatter internal functions

2021-08-17 Thread Hongtao Liu via Gcc-patches
On Wed, Aug 18, 2021 at 11:24 AM Hongtao Liu wrote: > > On Tue, Aug 17, 2021 at 10:43 PM Richard Biener via Gcc-patches > wrote: > > > > On Tue, Aug 17, 2021 at 3:29 PM Richard Biener via Gcc-patches > > wrote: > > > > > > This is an attempt to start moving the x86 backend to use > > > standard

Re: [PATCH] move x86 to use gather/scatter internal functions

2021-08-17 Thread Hongtao Liu via Gcc-patches
On Tue, Aug 17, 2021 at 10:43 PM Richard Biener via Gcc-patches wrote: > > On Tue, Aug 17, 2021 at 3:29 PM Richard Biener via Gcc-patches > wrote: > > > > This is an attempt to start moving the x86 backend to use > > standard pattern names for [mask_]gather_load and [mask_]scatter_store > > rathe

Re: [PATCH] move x86 to use gather/scatter internal functions

2021-08-17 Thread Hongtao Liu via Gcc-patches
On Tue, Aug 17, 2021 at 10:43 PM Richard Biener via Gcc-patches wrote: > > On Tue, Aug 17, 2021 at 3:29 PM Richard Biener via Gcc-patches > wrote: > > > > This is an attempt to start moving the x86 backend to use > > standard pattern names for [mask_]gather_load and [mask_]scatter_store > > rathe

Re: [PATCH] move x86 to use gather/scatter internal functions

2021-08-17 Thread Richard Biener via Gcc-patches
On Tue, Aug 17, 2021 at 3:29 PM Richard Biener via Gcc-patches wrote: > > This is an attempt to start moving the x86 backend to use > standard pattern names for [mask_]gather_load and [mask_]scatter_store > rather than using the builtin_{gather,scatter} target hooks. > > I've started with AVX2 gat

[PATCH] move x86 to use gather/scatter internal functions

2021-08-17 Thread Richard Biener via Gcc-patches
This is an attempt to start moving the x86 backend to use standard pattern names for [mask_]gather_load and [mask_]scatter_store rather than using the builtin_{gather,scatter} target hooks. I've started with AVX2 gathers and given x86 only supports masked gather I only implemented mask_gather_load