All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Li, Liang Z" <liang.z.li@intel.com>
To: Richard Henderson <rth@twiddle.net>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Cc: "mst@redhat.com" <mst@redhat.com>,
	"quintela@redhat.com" <quintela@redhat.com>,
	"dgilbert@redhat.com" <dgilbert@redhat.com>,
	"stefanha@redhat.com" <stefanha@redhat.com>,
	"amit.shah@redhat.com" <amit.shah@redhat.com>,
	"pbonzini@redhat.com" <pbonzini@redhat.com>
Subject: Re: [Qemu-devel] [v3 1/3] cutils: add avx2 instruction optimization
Date: Thu, 10 Dec 2015 01:10:24 +0000	[thread overview]
Message-ID: <F2CBF3009FA73547804AE4C663CAB28E0238A498@SHSMSX101.ccr.corp.intel.com> (raw)
In-Reply-To: <56684141.5020504@twiddle.net>

> 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 

  reply	other threads:[~2015-12-10  1:10 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-08 12:08 [Qemu-devel] [v3 0/3] add avx2 instruction optimization Liang Li
2015-12-08 12:08 ` [Qemu-devel] [v3 1/3] cutils: " Liang Li
2015-12-08 16:09   ` Richard Henderson
2015-12-09  9:32     ` Li, Liang Z
2015-12-09 14:57       ` Richard Henderson
2015-12-10  1:10         ` Li, Liang Z [this message]
2015-12-10  9:03         ` Paolo Bonzini
2015-12-10  9:22           ` Li, Liang Z
2015-12-10  9:51             ` Paolo Bonzini
2015-12-08 12:08 ` [Qemu-devel] [v3 2/3] configure: detect ifunc attribute Liang Li
2015-12-08 12:08 ` [Qemu-devel] [v3 3/3] configure: add options to config avx2 Liang Li
2015-12-08 12:54   ` Peter Maydell
2015-12-08 14:18     ` Li, Liang Z

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=F2CBF3009FA73547804AE4C663CAB28E0238A498@SHSMSX101.ccr.corp.intel.com \
    --to=liang.z.li@intel.com \
    --cc=amit.shah@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    --cc=rth@twiddle.net \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.