public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/98877] New: [AArch64] Inefficient code generated for tbl NEON intrinsics
@ 2021-01-29  6:51 spop at gcc dot gnu.org
  2021-01-29  7:39 ` [Bug target/98877] " pinskia at gcc dot gnu.org
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: spop at gcc dot gnu.org @ 2021-01-29  6:51 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 98877
           Summary: [AArch64] Inefficient code generated for tbl NEON
                    intrinsics
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: spop at gcc dot gnu.org
  Target Milestone: ---

The use of NEON intrinsics is inefficient and leads developers to prefer inline
assembly instead of intrinsics.

A similar performance bug for vmlal intrinsics was reported in
https://gcc.gnu.org/PR92665
The code generated by GCC for table lookups is also inefficient:

$ cat red.c
#include "arm_neon.h"

uint8x16_t fun(uint8x16_t lo, uint8x16_t hi, uint8x16_t idx) {
  uint8x16x2_t tab = { .val = {lo, hi} };
  uint8x16_t res = vqtbl2q_u8(tab, idx);
  return res;
}

$ gcc -O3 -S -o- red.c
fun:
        mov     v4.16b, v0.16b
        mov     v5.16b, v1.16b
        tbl     v0.16b, {v4.16b - v5.16b}, v2.16b
        ret

$ clang -O3 -S -o- red.c
fun:
        tbl     v0.16b, { v0.16b, v1.16b }, v2.16b
        ret

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

end of thread, other threads:[~2024-02-29  7:27 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-29  6:51 [Bug target/98877] New: [AArch64] Inefficient code generated for tbl NEON intrinsics spop at gcc dot gnu.org
2021-01-29  7:39 ` [Bug target/98877] " pinskia at gcc dot gnu.org
2021-01-29  7:40 ` pinskia at gcc dot gnu.org
2021-01-29  9:10 ` ktkachov at gcc dot gnu.org
2021-08-12  8:09 ` tnfchris at gcc dot gnu.org
2021-08-22  9:30 ` pinskia at gcc dot gnu.org
2021-08-22  9:30 ` pinskia at gcc dot gnu.org
2021-08-22 10:14 ` tnfchris at gcc dot gnu.org
2024-01-26  0:24 ` pinskia at gcc dot gnu.org
2024-02-27  8:34 ` pinskia at gcc dot gnu.org
2024-02-27 19:28 ` rsandifo at gcc dot gnu.org
2024-02-28  9:12 ` tnfchris at gcc dot gnu.org
2024-02-29  5:45 ` pinskia at gcc dot gnu.org
2024-02-29  7:26 ` tnfchris at gcc dot gnu.org
2024-02-29  7:27 ` tnfchris 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).