Re: [COMMITTED] i386: Use 2x-wider modes when emulating QImode vector instructions

2023-05-25 Thread Uros Bizjak via Gcc-patches
On Fri, May 26, 2023 at 4:12 AM Jiang, Haochen wrote: > > > gcc/ChangeLog: > > > > * config/i386/i386-expand.cc (ix86_expand_vecop_qihi2): > > Rewrite to expand to 2x-wider (e.g. V16QI -> V16HImode) > > instructions when available. Emulate truncation via > > ix86_expand_vec_perm_c

RE: [COMMITTED] i386: Use 2x-wider modes when emulating QImode vector instructions

2023-05-25 Thread Jiang, Haochen via Gcc-patches
> gcc/ChangeLog: > > * config/i386/i386-expand.cc (ix86_expand_vecop_qihi2): > Rewrite to expand to 2x-wider (e.g. V16QI -> V16HImode) > instructions when available. Emulate truncation via > ix86_expand_vec_perm_const_1 when native truncate insn > is not available. > (ix86

[COMMITTED] i386: Use 2x-wider modes when emulating QImode vector instructions

2023-05-25 Thread Uros Bizjak via Gcc-patches
Rewrite ix86_expand_vecop_qihi2 to expand fo 2x-wider (e.g. V16QI -> V16HImode) instructions when available. Currently, the compiler generates following assembly for V16QImode multiplication (-mavx2): vpunpcklbw %xmm0, %xmm0, %xmm3 vpunpcklbw %xmm1, %xmm1, %xmm2 vpunpckhbw