public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/113090] New: Suboptimal vector permuation for 64-bit vector.
@ 2023-12-20  3:42 liuhongt at gcc dot gnu.org
  2023-12-20  8:16 ` [Bug target/113090] " rguenth at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: liuhongt at gcc dot gnu.org @ 2023-12-20  3:42 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113090

            Bug ID: 113090
           Summary: Suboptimal vector permuation for 64-bit vector.
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: liuhongt at gcc dot gnu.org
  Target Milestone: ---

When working on PR113079, loop vectorizer try to reduc sum of v2si with
permuation, x86 backend generates

typedef int v2si __attribute__((vector_size(8)));

v2si
foo (v2si a, v2si b)
{
    return __builtin_shufflevector (a, b, 1, 2);
}

foo(int __vector(2), int __vector(2)):
        vpshufb xmm0, xmm0, XMMWORD PTR .LC0[rip]
        vpshufb xmm1, xmm1, XMMWORD PTR .LC1[rip]
        vpor    xmm0, xmm0, xmm1

But it can be better with

        .cfi_startproc
        punpcklqdq      %xmm1, %xmm0
        pshufd  $153, %xmm0, %xmm0
        ret

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

end of thread, other threads:[~2024-05-07  7:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-20  3:42 [Bug target/113090] New: Suboptimal vector permuation for 64-bit vector liuhongt at gcc dot gnu.org
2023-12-20  8:16 ` [Bug target/113090] " rguenth at gcc dot gnu.org
2024-05-07  7:44 ` cvs-commit at gcc dot gnu.org
2024-05-07  7:45 ` liuhongt 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).