public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/56876] New: Combine does not invent new moves
@ 2013-04-08 14:24 glisse at gcc dot gnu.org
  2013-04-08 15:53 ` [Bug target/56876] " pinskia at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: glisse at gcc dot gnu.org @ 2013-04-08 14:24 UTC (permalink / raw)
  To: gcc-bugs


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.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-12-27  5:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-08 14:24 [Bug rtl-optimization/56876] New: Combine does not invent new moves glisse at gcc dot gnu.org
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

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).