1 /* { dg-require-effective-target vect_double } */
5 void __attribute__((noinline
,noclone
))
6 foo (double *a4
, int n
)
8 for (int i
= 0; i
< n
; ++i
)
10 /* We may not apply interleaving to the group (a), (b) because of (c).
11 Instead group (d) and (b). */
12 double tem1
= a4
[i
*4] + a4
[i
*4+n
*4] /* (a) */;
13 double tem2
= a4
[i
*4+2*n
*4+1];
14 a4
[i
*4+n
*4+1] = tem1
; /* (c) */
16 double tem3
= a4
[i
*4] - tem2
;
17 double tem4
= tem3
+ a4
[i
*4+n
*4] /* (d) */;
18 a4
[i
*4+n
*4+1] = tem4
+ a4
[i
*4+n
*4+1] /* (b) */;
21 int main(int argc
, char **argv
)
25 double a42
[4 * n
* 3];
27 for (int i
= 0; i
< 4 * n
* 3; ++i
)
30 __asm__
volatile ("": : : "memory");
33 for (int i
= 0; i
< n
; ++i
)
35 double tem1
= a42
[i
*4] + a42
[i
*4+n
*4];
36 double tem2
= a42
[i
*4+2*n
*4+1];
37 a42
[i
*4+n
*4+1] = tem1
;
39 double tem3
= a42
[i
*4] - tem2
;
40 double tem4
= tem3
+ a42
[i
*4+n
*4];
41 a42
[i
*4+n
*4+1] = tem4
+ a42
[i
*4+n
*4+1];
42 __asm__
volatile ("": : : "memory");
45 for (int i
= 0; i
< 4 * n
* 3; ++i
)
51 /* For v2df we try to use SLP and fail miserably. */
52 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_sizes_32B_16B } } } */