public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "glisse at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/54716] New: Select best typed instruction for bitwise operations
Date: Wed, 26 Sep 2012 12:37:00 -0000	[thread overview]
Message-ID: <bug-54716-4@http.gcc.gnu.org/bugzilla/> (raw)


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54716

             Bug #: 54716
           Summary: Select best typed instruction for bitwise operations
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: glisse@gcc.gnu.org


Hello,

consider these 3 versions of OR:

#include <x86intrin.h>

__m256d f(__m256d x,__m256d y){
  return (__m256d)((__m256i)x|(__m256i)y);
}

__m256d g(__m256d x,__m256d y){
  return _mm256_or_pd(x,y);
}

__m256i h(__m256i x,__m256i y){
  return x|y;
}

With -mavx, they compile to vorps, vorpd, vorps.
With -mavx2, they compile to vpor, vorpd, vpor.

Functions g and h are fine, but for f (which is about the only way to write OR
using the C vector extensions, since | doesn't apply to floats) it would be
great to see vorpd in both cases.


             reply	other threads:[~2012-09-26 12:37 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-26 12:37 glisse at gcc dot gnu.org [this message]
2012-09-26 13:44 ` [Bug target/54716] " jakub at gcc dot gnu.org
2012-09-26 13:46 ` jakub at gcc dot gnu.org
2012-09-26 13:56 ` ubizjak at gmail dot com
2012-09-26 14:01 ` ubizjak at gmail dot com
2012-09-26 14:20 ` ubizjak at gmail dot com
2012-09-26 14:23 ` jakub at gcc dot gnu.org
2012-09-26 14:57 ` jakub at gcc dot gnu.org
2012-09-26 15:41 ` jakub at gcc dot gnu.org
2012-09-26 15:53 ` glisse at gcc dot gnu.org
2012-09-26 20:59 ` ubizjak at gmail dot com
2012-09-28 12:21 ` jakub at gcc dot gnu.org
2012-11-10 12:55 ` glisse at gcc dot gnu.org

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=bug-54716-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).