public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/104010] New: [12 regression] short loop no longer vectorized with Neon after r12-6513
@ 2022-01-13 15:52 clyon at gcc dot gnu.org
  2022-01-13 15:56 ` [Bug tree-optimization/104010] " pinskia at gcc dot gnu.org
                   ` (16 more replies)
  0 siblings, 17 replies; 18+ messages in thread
From: clyon at gcc dot gnu.org @ 2022-01-13 15:52 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 104010
           Summary: [12 regression] short loop no longer vectorized with
                    Neon after r12-6513
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: clyon at gcc dot gnu.org
  Target Milestone: ---

This short loop:
void test_vcmpeq_s32x2 (int32_t * __restrict__ dest, int32_t *a, int32_t *b)
{
  int i;
  for (i=0; i<4; i++) {
    dest[i] = a[i] == b[i];
  }
}

used to be vectorized as:
test_vcmpeq_s32x2:
        vld1.32 {d16}, [r1]
        vmov.i32        d17, #0x1  @ v2si
        vld1.32 {d19}, [r2]
        vmov.i32        d18, #0  @ v2si
        vceq.i32        d16, d16, d19
        vbsl    d16, d17, d18
        vst1.32 {d16}, [r0]
        bx      lr

After r12-6513, we get:
test_vcmpeq_s32x2:
        ldr     ip, [r1]
        ldr     r3, [r1, #4]
        str     lr, [sp, #-4]!
        ldr     lr, [r2]
        ldr     r2, [r2, #4]
        sub     ip, ip, lr
        clz     ip, ip
        sub     r3, r3, r2
        lsr     ip, ip, #5
        clz     r3, r3
        lsr     r3, r3, #5
        str     ip, [r0]
        str     r3, [r0, #4]
        ldr     pc, [sp], #4

when compiling for arm-none-linux-gnueabihf with -mcpu=cortex-a9 -mfpu=neon

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

end of thread, other threads:[~2022-04-19 14:43 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-13 15:52 [Bug tree-optimization/104010] New: [12 regression] short loop no longer vectorized with Neon after r12-6513 clyon at gcc dot gnu.org
2022-01-13 15:56 ` [Bug tree-optimization/104010] " pinskia at gcc dot gnu.org
2022-01-13 16:00 ` clyon at gcc dot gnu.org
2022-01-14  7:58 ` [Bug tree-optimization/104010] [12 regression] short loop no longer vectorized with Neon after r12-3362 rguenth at gcc dot gnu.org
2022-01-14  8:19 ` rguenth at gcc dot gnu.org
2022-01-14  8:35 ` rguenth at gcc dot gnu.org
2022-01-14  9:11 ` rguenth at gcc dot gnu.org
2022-04-13 10:42 ` rearnsha at gcc dot gnu.org
2022-04-13 10:43 ` rearnsha at gcc dot gnu.org
2022-04-13 11:36 ` rguenth at gcc dot gnu.org
2022-04-13 11:37 ` rguenth at gcc dot gnu.org
2022-04-13 11:38 ` rguenth at gcc dot gnu.org
2022-04-13 11:52 ` rguenth at gcc dot gnu.org
2022-04-13 13:12 ` clyon at gcc dot gnu.org
2022-04-14 11:30 ` rguenth at gcc dot gnu.org
2022-04-14 11:31 ` rguenth at gcc dot gnu.org
2022-04-19 14:42 ` cvs-commit at gcc dot gnu.org
2022-04-19 14:43 ` rguenth 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).