CLooG 0.18.4
[cloog.git] / test / reservoir / lim-lam3.good.c
blob0cddca9a1f2c7b447f3b7e77e42f640aeb200e43
1 /* Generated from ../../../git/cloog/test/./reservoir/lim-lam3.cloog by CLooG 0.14.0-72-gefe2fc2 gmp bits in 0.04s. */
2 extern void hash(int);
4 /* Useful macros. */
5 #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d))
6 #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d))
7 #define max(x,y) ((x) > (y) ? (x) : (y))
8 #define min(x,y) ((x) < (y) ? (x) : (y))
10 #define S1(i,j,k) { hash(1); hash(i); hash(j); hash(k); }
11 #define S2(i,j) { hash(2); hash(i); hash(j); }
12 #define S3(i,j) { hash(3); hash(i); hash(j); }
13 #define S4(i) { hash(4); hash(i); }
15 void test(int M)
17 /* Scattering iterators. */
18 int c2, c4, c6;
19 /* Original iterators. */
20 int i, j, k;
21 for (c2=5;c2<=min(5*M,8);c2++) {
22 if (c2%5 == 0) {
23 S4(c2/5) ;
26 for (c2=9;c2<=min(13,5*M-1);c2++) {
27 for (c4=max(1,ceild(c2-M-3,4));c4<=floord(c2-4,5);c4++) {
28 i = c2-4*c4-3 ;
29 S2(c2-4*c4-3,c4) ;
31 if (c2%5 == 0) {
32 S4(c2/5) ;
34 for (c4=max(1,ceild(c2-3*M-1,2));c4<=floord(c2-4,5);c4++) {
35 if ((c2+c4+2)%3 == 0) {
36 i = (c2-2*c4-1)/3 ;
37 S3((c2-2*c4-1)/3,c4) ;
41 for (c2=14;c2<=5*M-1;c2++) {
42 for (c4=max(2,ceild(c2-M-3,4));c4<=min(M-1,floord(c2-8,3));c4++) {
43 for (c6=max(1,ceild(c2-2*c4-M-5,2));c6<=min(c4-1,floord(c2-3*c4-6,2));c6++) {
44 i = c2-2*c4-2*c6-5 ;
45 S1(c2-2*c4-2*c6-5,c4,c6) ;
48 for (c4=max(ceild(c2-M-3,4),1);c4<=floord(c2-4,5);c4++) {
49 i = c2-4*c4-3 ;
50 S2(c2-4*c4-3,c4) ;
52 if (c2%5 == 0) {
53 S4(c2/5) ;
55 for (c4=max(ceild(c2-3*M-1,2),1);c4<=floord(c2-4,5);c4++) {
56 if ((c2+c4+2)%3 == 0) {
57 i = (c2-2*c4-1)/3 ;
58 S3((c2-2*c4-1)/3,c4) ;
62 if (M >= 2) {
63 c2 = 5*M ;
64 S4(M) ;