1 /* { dg-do compile } */
2 /* { dg-require-effective-target size32plus } */
3 /* { dg-additional-options "-march=core-avx2" { target { x86_64-*-* i?86-*-* } } } */
4 
5 typedef enum {
6  C = 0,               N, S, E, W, T, B,               NE, NW, SE, SW,               NT, NB, ST, SB,               ET, EB, WT, WB,               FLAGS, N_CELL_ENTRIES} CELL_ENTRIES;
7 typedef double LBM_Grid[(130)*100*100*N_CELL_ENTRIES];
foo(LBM_Grid srcGrid)8 void foo( LBM_Grid srcGrid )
9 {
10   double ux , uy , uz , rho ,         ux1, uy1, uz1, rho1,         ux2, uy2, uz2, rho2,         u2, px, py;
11   int i;
12   for( i = 0;
13        i < (N_CELL_ENTRIES*( 100*100));
14        i += N_CELL_ENTRIES )
15     {
16       rho1 = + ((srcGrid)[((C)+N_CELL_ENTRIES*( 100*100))+(i)])
17 	  + ((srcGrid)[((N)+N_CELL_ENTRIES*( 100*100))+(i)])
18 	  + ((srcGrid)[((S)+N_CELL_ENTRIES*( 100*100))+(i)])
19 	  + ((srcGrid)[((E)+N_CELL_ENTRIES*( 100*100))+(i)])
20 	  + ((srcGrid)[((W)+N_CELL_ENTRIES*( 100*100))+(i)])
21 	  + ((srcGrid)[((T)+N_CELL_ENTRIES*( 100*100))+(i)])
22 	  + ((srcGrid)[((B)+N_CELL_ENTRIES*( 100*100))+(i)])
23 	  + ((srcGrid)[((NE)+N_CELL_ENTRIES*( 100*100))+(i)])
24 	  + ((srcGrid)[((NW)+N_CELL_ENTRIES*( 100*100))+(i)])
25 	  + ((srcGrid)[((SE)+N_CELL_ENTRIES*( 100*100))+(i)])
26 	  + ((srcGrid)[((SW)+N_CELL_ENTRIES*( 100*100))+(i)])
27 	  + ((srcGrid)[((NT)+N_CELL_ENTRIES*( 100*100))+(i)])
28 	  + ((srcGrid)[((NB)+N_CELL_ENTRIES*( 100*100))+(i)])
29 	  + ((srcGrid)[((ST)+N_CELL_ENTRIES*( 100*100))+(i)])
30 	  + ((srcGrid)[((SB)+N_CELL_ENTRIES*( 100*100))+(i)])
31 	  + ((srcGrid)[((ET)+N_CELL_ENTRIES*( 100*100))+(i)])
32 	  + ((srcGrid)[((EB)+N_CELL_ENTRIES*( 100*100))+(i)])
33 	  + ((srcGrid)[((WT)+N_CELL_ENTRIES*( 100*100))+(i)])
34 	  + ((srcGrid)[((WB)+N_CELL_ENTRIES*( 100*100))+(i)]);
35       rho = 2.0*rho1 - rho2;
36       px = (((i / N_CELL_ENTRIES) % 100) / (0.5*(100-1))) - 1.0;
37       uz = 0.01 * (1.0-px*px) * (1.0-py*py);
38       u2 = 1.5 * (ux*ux + uy*uy + uz*uz);
39       (((srcGrid)[((C))+(i)])) = (1.0/ 3.0)*rho*(1.0 - u2);
40       (((srcGrid)[((N))+(i)])) = (1.0/18.0)*rho*(1.0 + uy*(4.5*uy + 3.0) - u2);
41     }
42 }
43