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

            Bug ID: 117032
           Summary: missing vectorization of V4HI to V4DF
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: enhancement
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pinskia at gcc dot gnu.org
  Target Milestone: ---
            Target: aarch64

GCC can vectorize V4HI to V4DF on aarch64 if going indirectly via V4SI.
That is take:
```
static inline 
void g(unsigned short *a, int *b)
{
        b[0] = a[0];
        b[1] = a[1];
        b[2] = a[2];
        b[3] = a[3];
}
static inline 
void g2(int *a, double *b)
{
        b[0] = a[0];
        b[1] = a[1];
        b[2] = a[2];
        b[3] = a[3];
}

void indirect(unsigned short *a, double *b)
{
  int t[4];
  g(a, t);
  g2(t, b);
}

void direct(unsigned short *a, double *b)
{
        b[0] = a[0];
        b[1] = a[1];
        b[2] = a[2];
        b[3] = a[3];
}

```

Reply via email to