Re: [PATCH] [i386] Optimize __builtin_shuffle_vector.

2021-08-16 Thread Hongtao Liu via Gcc-patches
On Mon, Aug 16, 2021 at 3:25 PM Hongtao Liu wrote: > > On Mon, Aug 16, 2021 at 3:11 PM Jakub Jelinek via Gcc-patches > wrote: > > > > On Mon, Aug 16, 2021 at 01:18:38PM +0800, liuhongt via Gcc-patches wrote: > > > + /* Accept VNxHImode and VNxQImode now. */ > > > + if (!TARGET_AVX512VL && GET_

Re: [PATCH] [i386] Optimize __builtin_shuffle_vector.

2021-08-16 Thread Hongtao Liu via Gcc-patches
On Mon, Aug 16, 2021 at 3:11 PM Jakub Jelinek via Gcc-patches wrote: > > On Mon, Aug 16, 2021 at 01:18:38PM +0800, liuhongt via Gcc-patches wrote: > > + /* Accept VNxHImode and VNxQImode now. */ > > + if (!TARGET_AVX512VL && GET_MODE_SIZE (mode) < 64) > > +return false; > > + > > + /* vper

Re: [PATCH] [i386] Optimize __builtin_shuffle_vector.

2021-08-16 Thread Jakub Jelinek via Gcc-patches
On Mon, Aug 16, 2021 at 01:18:38PM +0800, liuhongt via Gcc-patches wrote: > + /* Accept VNxHImode and VNxQImode now. */ > + if (!TARGET_AVX512VL && GET_MODE_SIZE (mode) < 64) > +return false; > + > + /* vpermw. */ > + if (!TARGET_AVX512BW && inner_size == 2) > +return false; > + > +

[PATCH] [i386] Optimize __builtin_shuffle_vector.

2021-08-15 Thread liuhongt via Gcc-patches
Hi: Here's updated patch which does 3 things: 1. Support vpermw/vpermb in ix86_expand_vec_one_operand_perm_avx512. 2. Support 256/128-bits vpermi2b in ix86_expand_vec_perm_vpermt2. 3. Add define_insn_and_split to optimize specific vector permutation to opmov{dw,wb,qd}. Bootstrapped and regtes