public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/96918] New: Failure to optimize vector shift left+shift right+or to pshuf
@ 2020-09-03 12:58 gabravier at gmail dot com
  2020-09-03 13:03 ` [Bug target/96918] " rguenth at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: gabravier at gmail dot com @ 2020-09-03 12:58 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 96918
           Summary: Failure to optimize vector shift left+shift right+or
                    to pshuf
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gabravier at gmail dot com
  Target Milestone: ---

typedef __INT16_TYPE__ v8i16 __attribute__((vector_size(16)));
typedef char v16i8 __attribute__((vector_size(16)));

v8i16 bswap_epi16(v8i16 x)
{
        return __builtin_ia32_psllwi128(x, 8) | __builtin_ia32_psrlwi128(x, 8);
}

This can be optimized to `return (v8i16)__builtin_ia32_pshufb128((v16i8)x,
v16i8{1, 0, 3, 2, 5, 4, 7, 6, 9, 8, 11, 10, 13, 12, 15, 14});`. This
transformation is done by LLVM, but not by GCC.

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

end of thread, other threads:[~2021-08-03  5:51 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-03 12:58 [Bug target/96918] New: Failure to optimize vector shift left+shift right+or to pshuf gabravier at gmail dot com
2020-09-03 13:03 ` [Bug target/96918] " rguenth at gcc dot gnu.org
2020-09-03 13:13 ` gabravier at gmail dot com
2020-09-03 13:21 ` jakub at gcc dot gnu.org
2020-09-03 14:30 ` gabravier at gmail dot com
2020-09-03 20:41 ` glisse at gcc dot gnu.org
2020-09-03 20:57 ` jakub at gcc dot gnu.org
2020-09-04  6:49 ` rguenth at gcc dot gnu.org
2021-08-03  5:10 ` pinskia at gcc dot gnu.org
2021-08-03  5:36 ` crazylht at gmail dot com
2021-08-03  5:51 ` crazylht at gmail dot com

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