Re: [Qemu-devel] [v3 1/3] cutils: add avx2 instruction optimization

2015-12-10 Thread Paolo Bonzini
On 09/12/2015 15:57, Richard Henderson wrote: >> I think you means the ' __attribute__((target("avx2")))', I have tried >> this way, the issue here is: >> without the ' -mavx2' option for gcc, there are compiling error: >> '__m256i undeclared', the __attribute__((target("avx2"))) >> can't

Re: [Qemu-devel] [v3 1/3] cutils: add avx2 instruction optimization

2015-12-10 Thread Li, Liang Z
> >> without the ' -mavx2' option for gcc, there are compiling error: > >> '__m256i undeclared', the __attribute__((target("avx2"))) can't solve > >> this issue. Any idea? > > > > You're right that you can't use the normal __m256i, as it doesn't get > > declared. > > It should be declared.

Re: [Qemu-devel] [v3 1/3] cutils: add avx2 instruction optimization

2015-12-10 Thread Paolo Bonzini
On 10/12/2015 10:22, Li, Liang Z wrote: without the ' -mavx2' option for gcc, there are compiling error: '__m256i undeclared', the __attribute__((target("avx2"))) can't solve this issue. Any idea? >>> >>> You're right that you can't use the normal __m256i, as it doesn't get >>>

Re: [Qemu-devel] [v3 1/3] cutils: add avx2 instruction optimization

2015-12-09 Thread Li, Liang Z
> On 12/08/2015 04:08 AM, Liang Li wrote: > > +++ b/util/buffer-zero-avx2.c > > @@ -0,0 +1,54 @@ > > +#include "qemu-common.h" > > + > > +#if defined CONFIG_IFUNC && defined CONFIG_AVX2 #include > > + > > +#define AVX2_VECTYPE__m256i > > +#define AVX2_SPLAT(p) _mm256_set1_epi8(*(p))

Re: [Qemu-devel] [v3 1/3] cutils: add avx2 instruction optimization

2015-12-09 Thread Richard Henderson
On 12/09/2015 01:32 AM, Li, Liang Z wrote: I think you means the ' __attribute__((target("avx2")))', I have tried this way, the issue here is: without the ' -mavx2' option for gcc, there are compiling error: '__m256i undeclared', the __attribute__((target("avx2"))) can't solve this issue.

Re: [Qemu-devel] [v3 1/3] cutils: add avx2 instruction optimization

2015-12-09 Thread Li, Liang Z
> On 12/09/2015 01:32 AM, Li, Liang Z wrote: > > I think you means the ' __attribute__((target("avx2")))', I have tried this > way, the issue here is: > > without the ' -mavx2' option for gcc, there are compiling error: > > '__m256i undeclared', the __attribute__((target("avx2"))) can't solve

[Qemu-devel] [v3 1/3] cutils: add avx2 instruction optimization

2015-12-08 Thread Liang Li
buffer_find_nonzero_offset() is a hot function during live migration. Now it use SSE2 intructions for optimization. For platform supports AVX2 instructions, use the AVX2 instructions for optimization can help to improve the performance about 30% comparing to SSE2. Zero page check can be faster

Re: [Qemu-devel] [v3 1/3] cutils: add avx2 instruction optimization

2015-12-08 Thread Richard Henderson
On 12/08/2015 04:08 AM, Liang Li wrote: > +++ b/util/buffer-zero-avx2.c > @@ -0,0 +1,54 @@ > +#include "qemu-common.h" > + > +#if defined CONFIG_IFUNC && defined CONFIG_AVX2 > +#include > +#define AVX2_VECTYPE__m256i > +#define AVX2_SPLAT(p) _mm256_set1_epi8(*(p)) > +#define