1 /* { dg-do compile } */
2 /* { dg-additional-options "-Ofast" } */
3 /* { dg-require-effective-target vect_double } */
4 
foo1x1(double * restrict y,const double * restrict x,int clen)5 void foo1x1(double* restrict y, const double* restrict x, int clen)
6 {
7   int xi = clen & 2;
8   double f_re = x[0+xi+0];
9   double f_im = x[4+xi+0];
10   int clen2 = (clen+xi) * 2;
11 #pragma GCC unroll 0
12   for (int c = 0; c < clen2; c += 8) {
13     // y[c] = y[c] - x[c]*conj(f);
14 #pragma GCC unroll 4
15     for (int k = 0; k < 4; ++k) {
16       double x_re = x[c+0+k];
17       double x_im = x[c+4+k];
18       double y_re = y[c+0+k];
19       double y_im = y[c+4+k];
20       y_re = y_re - x_re * f_re - x_im * f_im;;
21       y_im = y_im + x_re * f_im - x_im * f_re;
22       y[c+0+k] = y_re;
23       y[c+4+k] = y_im;
24     }
25   }
26 }
27 
28 /* { dg-final { scan-tree-dump "vectorizing stmts using SLP" "vect" } } */
29 /* { dg-final { scan-tree-dump "Loop contains only SLP stmts" "vect" } } */
30