[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [v3 1/3] cutils: add avx2 instruction optimization
From: |
Li, Liang Z |
Subject: |
Re: [Qemu-devel] [v3 1/3] cutils: add avx2 instruction optimization |
Date: |
Thu, 10 Dec 2015 01:10:24 +0000 |
> 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. Any idea?
>
> You're right that you can't use the normal __m256i, as it doesn't get
> declared.
> But you can define the same type within the function itself.
>
> Which is a simple matter of
>
> typedef long long __m256i __attribute__((vector_size(32)));
>
> From there, you might as well rely on other gcc extensions to instead write
>
> __m256i tmp0 = p[i + 0] | p[i + 1];
>
> rather than obfuscating the code with AVX2_VEC_OR.
>
>
Comparing this way to putting the related code to a separate file, I think the
latter is more simple.
Thanks
Liang
- [Qemu-devel] [v3 0/3] add avx2 instruction optimization, Liang Li, 2015/12/08
- [Qemu-devel] [v3 1/3] cutils: add avx2 instruction optimization, Liang Li, 2015/12/08
- Re: [Qemu-devel] [v3 1/3] cutils: add avx2 instruction optimization, Richard Henderson, 2015/12/08
- Re: [Qemu-devel] [v3 1/3] cutils: add avx2 instruction optimization, Li, Liang Z, 2015/12/09
- Re: [Qemu-devel] [v3 1/3] cutils: add avx2 instruction optimization, Richard Henderson, 2015/12/09
- Re: [Qemu-devel] [v3 1/3] cutils: add avx2 instruction optimization,
Li, Liang Z <=
- Re: [Qemu-devel] [v3 1/3] cutils: add avx2 instruction optimization, Paolo Bonzini, 2015/12/10
- Re: [Qemu-devel] [v3 1/3] cutils: add avx2 instruction optimization, Li, Liang Z, 2015/12/10
- Re: [Qemu-devel] [v3 1/3] cutils: add avx2 instruction optimization, Paolo Bonzini, 2015/12/10
[Qemu-devel] [v3 2/3] configure: detect ifunc attribute, Liang Li, 2015/12/08
[Qemu-devel] [v3 3/3] configure: add options to config avx2, Liang Li, 2015/12/08