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 rtl-optimization/56876] New: Combine does not invent new moves
Date: Mon, 08 Apr 2013 14:24:00 -0000	[thread overview]
Message-ID: <bug-56876-4@http.gcc.gnu.org/bugzilla/> (raw)


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

             Bug #: 56876
           Summary: Combine does not invent new moves
    Classification: Unclassified
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: enhancement
          Priority: P3
         Component: rtl-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: glisse@gcc.gnu.org
            Target: x86_64-linux-gnu


Hello,

I am looking at this testcase:

typedef unsigned long long vec __attribute__((vector_size(16)));
vec g;
vec f1(vec a, vec b){
  return ~a&b;
}
vec f2(vec a, vec b){
  return ~g&b;
}

which compiles to:

f1:
    pandn    %xmm1, %xmm0

f2:
    pcmpeqd    %xmm0, %xmm0
    pxor    g(%rip), %xmm0
    pand    %xmm1, %xmm0

whereas I would like to get, like I do with the _mm_andnot_si128 builtin:

    movdqa    g(%rip), %xmm0
    pandn    %xmm1, %xmm0

It seems that combine cannot match the pandn pattern because the first argument
is a memory load and not a register. In this case, it would be better if it
emitted a move to put it in a register so it can match, instead of giving up. I
don't know if there is a good way to characterize such situations where an
extra move is worth it.


             reply	other threads:[~2013-04-08 14:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-08 14:24 glisse at gcc dot gnu.org [this message]
2013-04-08 15:53 ` [Bug target/56876] " pinskia at gcc dot gnu.org
2021-12-26 22:38 ` pinskia at gcc dot gnu.org
2021-12-27  5:47 ` pinskia 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-56876-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).