Re: [PATCH] i386: Optimize vpsubusw compared to 0 into vpcmpleuw or vpcmpnltuw[PR96906]

2020-12-02 Thread Hongtao Liu via Gcc-patches
On Thu, Dec 3, 2020 at 2:22 AM Jakub Jelinek wrote: > > On Tue, Dec 01, 2020 at 12:49:03PM +0800, Hongtao Liu via Gcc-patches wrote: > > +bool neq_p = INTVAL (operands[4]) >> 2; > > +/* LE: 2, NLT: 5, NLE: 6, LT: 1 */ > > +rtx cmp_predicate = neq_p ? GEN_INT (6) : GEN_INT (2); > > +

Re: [PATCH] i386: Optimize vpsubusw compared to 0 into vpcmpleuw or vpcmpnltuw[PR96906]

2020-12-02 Thread Jakub Jelinek via Gcc-patches
On Tue, Dec 01, 2020 at 12:49:03PM +0800, Hongtao Liu via Gcc-patches wrote: > +bool neq_p = INTVAL (operands[4]) >> 2; > +/* LE: 2, NLT: 5, NLE: 6, LT: 1 */ > +rtx cmp_predicate = neq_p ? GEN_INT (6) : GEN_INT (2); > +if (MEM_P (operands[1])) > + { > + std::swap (operands

Re: [PATCH] i386: Optimize vpsubusw compared to 0 into vpcmpleuw or vpcmpnltuw[PR96906]

2020-11-30 Thread Hongtao Liu via Gcc-patches
On Mon, Nov 30, 2020 at 9:46 PM Jakub Jelinek wrote: > > On Mon, Nov 30, 2020 at 09:11:10PM +0800, Hongtao Liu wrote: > > +;; PR96906 - optimize vpsubusw compared to 0 into vpcmpleuw or vpcmpnltuw. > > +(define_split > > + [(set (match_operand: 0 "register_operand") > > +(unspec: > > +

Re: [PATCH] i386: Optimize vpsubusw compared to 0 into vpcmpleuw or vpcmpnltuw[PR96906]

2020-11-30 Thread Jakub Jelinek via Gcc-patches
On Mon, Nov 30, 2020 at 09:11:10PM +0800, Hongtao Liu wrote: > +;; PR96906 - optimize vpsubusw compared to 0 into vpcmpleuw or vpcmpnltuw. > +(define_split > + [(set (match_operand: 0 "register_operand") > +(unspec: > + [(us_minus:VI12_AVX512VL > + (match_operand:VI12_

[PATCH] i386: Optimize vpsubusw compared to 0 into vpcmpleuw or vpcmpnltuw[PR96906]

2020-11-30 Thread Hongtao Liu via Gcc-patches
Hi: This patch is quite similar like what jakub did in https://gcc.gnu.org/pipermail/gcc-patches/2020-November/560151.html but for target avx512bw. .i.e. for -mavx512bw -mavx512vl transform code from vpsubusw%xmm1, %xmm0, %xmm0 vpxor %xmm1, %xmm1, %xmm1 vpcmpw