Re: [PATCH 2/2] util: add util function buffer_zero_avx512()

2020-02-25 Thread Richard Henderson
On 2/24/20 11:34 PM, Robert Hoo wrote: > Considering the length's dependency on sse2/sse4/avx2/avx512 and the > algorithms, as well as future's possible changes, additions, I'd rather > roll back to your original suggestion, use a companion variable with > each accel_fn(). How do you like it? How

Re: [PATCH 2/2] util: add util function buffer_zero_avx512()

2020-02-24 Thread Robert Hoo
On Mon, 2020-02-24 at 08:13 -0800, Richard Henderson wrote: > On 2/23/20 11:07 PM, Robert Hoo wrote: > > Inspired by your suggestion, I'm thinking go further: use immediate > > rather than a global variable, so that saves 1 memory(/cache) > > access. > > > > #ifdef CONFIG_AVX512F_OPT > > #defi

Re: [PATCH 2/2] util: add util function buffer_zero_avx512()

2020-02-24 Thread Richard Henderson
On 2/23/20 11:07 PM, Robert Hoo wrote: > Inspired by your suggestion, I'm thinking go further: use immediate > rather than a global variable, so that saves 1 memory(/cache) access. > > #ifdef CONFIG_AVX512F_OPT > #define OPTIMIZE_LEN256 > #else > #define OPTIMIZE_LEN64 > #endif With t

Re: [PATCH 2/2] util: add util function buffer_zero_avx512()

2020-02-23 Thread Robert Hoo
Thanks Richard:-) Sorry for late reply. On Thu, 2020-02-13 at 10:20 -0800, Richard Henderson wrote: > On 2/12/20 11:52 PM, Robert Hoo wrote: > > And initialize buffer_is_zero() with it, when Intel AVX512F is > > available on host. > > > > This function utilizes Intel AVX512 fundamental instruction

Re: [PATCH 2/2] util: add util function buffer_zero_avx512()

2020-02-13 Thread Richard Henderson
On 2/12/20 11:52 PM, Robert Hoo wrote: > And initialize buffer_is_zero() with it, when Intel AVX512F is > available on host. > > This function utilizes Intel AVX512 fundamental instructions which > perform over previous AVX2 instructions. Is it not still true that any AVX512 insn will cause the e

Re: [PATCH 2/2] util: add util function buffer_zero_avx512()

2020-02-13 Thread Robert Hoo
On Thu, 2020-02-13 at 11:30 +0100, Paolo Bonzini wrote: > On 13/02/20 08:52, Robert Hoo wrote: > > + > > +} > > +#pragma GCC pop_options > > +#endif > > + > > + > > /* Note that for test_buffer_is_zero_next_accel, the most > > preferred > > * ISA must have the least significant bit. > > */ > >

Re: [PATCH 2/2] util: add util function buffer_zero_avx512()

2020-02-13 Thread Paolo Bonzini
On 13/02/20 08:52, Robert Hoo wrote: > + > +} > +#pragma GCC pop_options > +#endif > + > + > /* Note that for test_buffer_is_zero_next_accel, the most preferred > * ISA must have the least significant bit. > */ > -#define CACHE_AVX21 > -#define CACHE_SSE42 > -#define CACHE_SSE24 >

[PATCH 2/2] util: add util function buffer_zero_avx512()

2020-02-12 Thread Robert Hoo
And initialize buffer_is_zero() with it, when Intel AVX512F is available on host. This function utilizes Intel AVX512 fundamental instructions which perform over previous AVX2 instructions. Signed-off-by: Robert Hoo --- include/qemu/cpuid.h | 3 +++ util/bufferiszero.c | 56 ++