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

            Bug ID: 113171
           Summary: Unneeded zero extend after widening load with SVE
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tnfchris at gcc dot gnu.org
  Target Milestone: ---
            Target: aarch64*

The following testcase

#include <stdint.h>

void __attribute__ ((noinline, noclone))
unpack_double_int_plus9 (double *d, uint32_t *s, int size)
{
  for (int i = 0; i < size; i++)
    d[i] = (double) (s[i] + 9);
}

compiled with

-march=armv8-a+sve -O2 -ftree-vectorize

generates:

.L3:
        ld1w    z31.d, p7/z, [x1, x3, lsl 2]
        add     z31.s, z31.s, #9
        uxtw    z31.d, p6/m, z31.d
        scvtf   z31.d, p6/m, z31.d
        st1d    z31.d, p7, [x0, x3, lsl 3]
        incd    x3
        whilelo p7.d, w3, w2
        b.any   .L3

which looks like the zero extend is unneeded.

Reply via email to