public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/54400] New: recognize haddpd
@ 2012-08-29  6:10 glisse at gcc dot gnu.org
  2012-09-01  9:40 ` [Bug target/54400] " glisse at gcc dot gnu.org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: glisse at gcc dot gnu.org @ 2012-08-29  6:10 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 54400
           Summary: recognize haddpd
    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
            Target: x86_64-linux-gnu


Hello,

for this program:

#include <x86intrin.h>
double f(__m128d v){return v[1]+v[0];}

gcc -O3 -msse4 (same with -Os) generates:

    movapd    %xmm0, %xmm2
    unpckhpd    %xmm2, %xmm2
    movapd    %xmm2, %xmm1
    addsd    %xmm0, %xmm1
    movapd    %xmm1, %xmm0

(yes, the number of mov instructions is a bit high...)

Looking at the x86 backend, it can expand reduc_splus_v2df and
__builtin_ia32_haddpd, but it doesn't provide any pattern that could be
recognized. hsubpd is even less present.

It seems to me that, considering only the low part of the result of haddpd, the
pattern should be small enough to be matched: (plus (vec_select (match_operand
1) const_a) (vec_select (match_dup 1) const_b)) where a and b are 0 and 1 in
any order.


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

end of thread, other threads:[~2021-09-11 14:19 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-29  6:10 [Bug target/54400] New: recognize haddpd glisse at gcc dot gnu.org
2012-09-01  9:40 ` [Bug target/54400] " glisse at gcc dot gnu.org
2012-09-03 10:13 ` [Bug middle-end/54400] " rguenth at gcc dot gnu.org
2012-09-03 10:22 ` glisse at gcc dot gnu.org
2012-10-08 20:46 ` glisse at gcc dot gnu.org
2012-10-08 21:03 ` [Bug middle-end/54400] recognize vector reductions glisse at gcc dot gnu.org
2012-10-25  8:40 ` vincenzo.innocente at cern dot ch
2021-06-08 13:36 ` rguenth at gcc dot gnu.org
2021-06-08 22:04 ` glisse at gcc dot gnu.org
2021-06-17  7:52 ` cvs-commit at gcc dot gnu.org
2021-06-17  8:00 ` rguenth at gcc dot gnu.org
2021-09-11 14:19 ` 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).