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

* [Bug target/113090] Suboptimal vector permuation for 64-bit vector.
  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 ` 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
  2 siblings, 0 replies; 4+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-12-20  8:16 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2023-12-20
             Status|UNCONFIRMED                 |NEW

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

* [Bug target/113090] Suboptimal vector permuation for 64-bit vector.
  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
  2 siblings, 0 replies; 4+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-05-07  7:44 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by hongtao Liu <liuhongt@gcc.gnu.org>:

https://gcc.gnu.org/g:a9f642783853b60bb0a59562b8ab3ed10ec01641

commit r15-234-ga9f642783853b60bb0a59562b8ab3ed10ec01641
Author: liuhongt <hongtao.liu@intel.com>
Date:   Wed Dec 20 11:54:43 2023 +0800

    Optimize 64-bit vector permutation with punpcklqdq + 128-bit vector pshuf.

    gcc/ChangeLog:

            PR target/113090
            * config/i386/i386-expand.cc
            (expand_vec_perm_punpckldq_pshuf): New function.
            (ix86_expand_vec_perm_const_1): Try
            expand_vec_perm_punpckldq_pshuf for sequence of 2
            instructions.

    gcc/testsuite/ChangeLog:

            * gcc.target/i386/pr113090.c: New test.

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

* [Bug target/113090] Suboptimal vector permuation for 64-bit vector.
  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
  2 siblings, 0 replies; 4+ messages in thread
From: liuhongt at gcc dot gnu.org @ 2024-05-07  7:45 UTC (permalink / raw)
  To: gcc-bugs

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

Hongtao Liu <liuhongt at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #2 from Hongtao Liu <liuhongt at gcc dot gnu.org> ---
Fixed in GCC15

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