Re: [PATCH 3/3] libcpp: add AVX2 helper

2024-08-20 Thread Richard Biener
On Thu, Aug 8, 2024 at 7:44 PM Alexander Monakov wrote: > > > > On Wed, 7 Aug 2024, Richard Biener wrote: > > > > > OK with that change. > > > > > > Did you think about a AVX512 version (possibly with 32 byte vectors)? > > > In case there's a more efficient variant of pshufb/pmovmskb available > >

Re: [PATCH 3/3] libcpp: add AVX2 helper

2024-08-08 Thread Alexander Monakov
> On Wed, 7 Aug 2024, Richard Biener wrote: > > > OK with that change. > > > > Did you think about a AVX512 version (possibly with 32 byte vectors)? > > In case there's a more efficient variant of pshufb/pmovmskb available > > there - possibly > > the load on the branch unit could be lessened w

Re: [PATCH 3/3] libcpp: add AVX2 helper

2024-08-07 Thread Alexander Monakov
On Wed, 7 Aug 2024, Richard Biener wrote: > OK with that change. > > Did you think about a AVX512 version (possibly with 32 byte vectors)? > In case there's a more efficient variant of pshufb/pmovmskb available > there - possibly > the load on the branch unit could be lessened with using maskin

Re: [PATCH 3/3] libcpp: add AVX2 helper

2024-08-07 Thread Richard Biener
On Wed, Aug 7, 2024 at 7:41 AM Alexander Monakov wrote: > > > On Tue, 6 Aug 2024, Alexander Monakov wrote: > > > --- a/libcpp/files.cc > > +++ b/libcpp/files.cc > [...] > > + pad = HAVE_AVX2 ? 32 : 16; > > This should have been > > #ifdef HAVE_AVX2 > pad = 32; > #else > pad = 16; > #endif OK

Re: [PATCH 3/3] libcpp: add AVX2 helper

2024-08-06 Thread Alexander Monakov
On Tue, 6 Aug 2024, Alexander Monakov wrote: > --- a/libcpp/files.cc > +++ b/libcpp/files.cc [...] > + pad = HAVE_AVX2 ? 32 : 16; This should have been #ifdef HAVE_AVX2 pad = 32; #else pad = 16; #endif Alexander

[PATCH 3/3] libcpp: add AVX2 helper

2024-08-06 Thread Alexander Monakov
Use the same PSHUFB-based matching as in the SSSE3 helper, just 2x wider. Directly use the new helper if __AVX2__ is defined. It makes the other helpers unused, so mark them inline to prevent warnings. Rewrite and simplify init_vectorized_lexer. libcpp/ChangeLog: * files.cc (read_file_g