public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/43147]  New: SSE shuffle merge
@ 2010-02-23  1:27 liranuna at gmail dot com
  2010-02-23  1:37 ` [Bug rtl-optimization/43147] " liranuna at gmail dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: liranuna at gmail dot com @ 2010-02-23  1:27 UTC (permalink / raw)
  To: gcc-bugs

I've noticed that GCC (my current version is 4.4.1) doesn't fully optimize SSE
shuffle merges, as seen in this example: 

#include <xmmintrin.h>

extern void printv(__m128 m);

int main()
{
        m = _mm_shuffle_ps(m, m, 0xC9); // Those two shuffles together swap
pairs
        m = _mm_shuffle_ps(m, m, 0x2D); // And could be optimized to 0x4E
        printv(m);

        return 0;
}

This code generates the following assembly:

        movaps  .LC1, %xmm1
        shufps  $201, %xmm1, %xmm1
        shufps  $45, %xmm1, %xmm1    ; <-- Both should merge to 78
        movaps  %xmm1, %xmm0
        movaps  %xmm1, -24(%ebp)

        .LC0:
                .long   1065353216 ; 1.0f
                .long   1073741824 ; 2.0f
                .long   1077936128 ; 3.0f
                .long   1082130432 ; 4.0f

Would be nice to see it as an enhancement!


-- 
           Summary: SSE shuffle merge
           Product: gcc
           Version: 4.4.1
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: rtl-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: liranuna at gmail dot com
 GCC build triplet: x86_64-linux-gnu
  GCC host triplet: x86_64-linux-gnu
GCC target triplet: x86_64-linux-gnu


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


^ permalink raw reply	[flat|nested] 14+ messages in thread
[parent not found: <bug-43147-4@http.gcc.gnu.org/bugzilla/>]

end of thread, other threads:[~2023-08-22  4:32 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-23  1:27 [Bug rtl-optimization/43147] New: SSE shuffle merge liranuna at gmail dot com
2010-02-23  1:37 ` [Bug rtl-optimization/43147] " liranuna at gmail dot com
2010-02-23  1:42 ` pinskia at gcc dot gnu dot org
2010-02-23  1:42 ` pinskia at gcc dot gnu dot org
     [not found] <bug-43147-4@http.gcc.gnu.org/bugzilla/>
2011-10-23  8:40 ` marc.glisse at normalesup dot org
2012-05-07 15:00 ` glisse at gcc dot gnu.org
2021-08-24  1:57 ` hjl.tools at gmail dot com
2021-08-25  8:42 ` crazylht at gmail dot com
2021-08-25  8:52 ` pinskia at gcc dot gnu.org
2021-08-25  8:54 ` glisse at gcc dot gnu.org
2021-08-25  9:20 ` crazylht at gmail dot com
2021-08-27  0:51 ` cvs-commit at gcc dot gnu.org
2021-08-27  1:00 ` crazylht at gmail dot com
2023-08-22  4:32 ` 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).