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

            Bug ID: 126182
           Summary: Inefficient code on AArch64 for vsetq_lane_s32 under
                    -march=armv9-a
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pfustc at gcc dot gnu.org
  Target Milestone: ---

Reproducer:

#include <arm_neon.h>

int32x4_t foo(int32x4_t vec, int val) {
    return vsetq_lane_s32(val, vec, 0);
}

Under "-O3":

foo:
        ins     v0.s[0], w0
        ret

Under "-O3 -march=armv9-a":

foo:
        sub     sp, sp, #16
        str     w0, [sp, 12]
        add     x0, sp, 12
        ld1     {v0.s}[0], [x0]
        add     sp, sp, 16
        ret

Reply via email to