summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr94269.c
blob: 49d57044f787ef98382dc3d6bb1a95d58c86ea51 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/* { dg-do compile { target aarch64*-*-* } } */
/* { dg-options "-O2 -ftree-loop-vectorize -funsafe-math-optimizations -march=armv8.2-a+sve -msve-vector-bits=256" } */

float
foo(long n, float *x, int inc_x,
            float *y, int inc_y)
{
  float dot = 0.0;
  int ix = 0, iy = 0;

  if (n < 0) {
    return dot;
  }

  int i = 0;
  while (i < n) {
    dot += y[iy] * x[ix];
    ix  += inc_x;
    iy  += inc_y;
    i++;
  }

  return dot;
}

/* { dg-final { scan-assembler-not "smaddl" { target aarch64*-*-* } } } */