OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.dg/] [graphite/] [interchange-8.c] - Blame information for rev 298

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 298 jeremybenn
#define DEBUG 0
2
#if DEBUG
3
#include <stdio.h>
4
#endif
5
 
6
int B[4];
7
int A[4][4][4][4];
8
 
9
static int __attribute__((noinline))
10
foo (void)
11
{
12
  int i, j, k, l;
13
 
14
  for (l = 0; l < 4; l++)
15
    {
16
      for (k = 0; k < 4; k++)
17
        {
18
          for (j = 0; j < 4; j++)
19
            {
20
              for (i = 0; i < 2; i++)
21
                {
22
                  B[i] = A[i][k][j][l] + A[3 - i][k][j][l];
23
                  B[3 - i] = A[i][k][j][l] - A[3 - i][k][j][l];
24
                }
25
              A[0][k][j][l] = B[0] + B[1];
26
              A[2][k][j][l] = B[0] - B[1];
27
              A[1][k][j][l] = B[3] + B[2];
28
              A[3][k][j][l] = B[3] - B[2];
29
            }
30
 
31
          for (i = 0; i < 4; i++)
32
            {
33
              for (j = 0; j < 2; j++)
34
                {
35
                  B[j] = A[i][k][j][l] + A[i][k][3 - j][l];
36
                  B[3 - j] = A[i][k][j][l] - A[i][k][3 - j][l];
37
                }
38
              A[i][k][0][l] = B[0] + B[1];
39
              A[i][k][2][l] = B[0] - B[1];
40
              A[i][k][1][l] = B[3] + B[2];
41
              A[i][k][3][l] = B[3] - B[2];
42
            }
43
        }
44
    }
45
 
46
  return A[0][1][0][2] + A[0][3][0][3] + A[0][2][0][2] + A[0][1][0][1] + A[3][3][0][2];
47
}
48
 
49
extern void abort ();
50
 
51
int
52
main (void)
53
{
54
  int i, j, k, l, res;
55
 
56
  for (i = 0; i < 4; i++)
57
    B[i] = 2;
58
 
59
  for (i = 0; i < 4; i++)
60
    for (j = 0; j < 4; j++)
61
      for (k = 0; k < 4; k++)
62
        for (l = 0; l < 4; l++)
63
          A[i][j][k][l] = i + j + k + l;
64
 
65
  res = foo ();
66
 
67
#if DEBUG
68
  for (i = 0; i < 4; i++)
69
    for (j = 0; j < 4; j++)
70
      for (k = 0; k < 4; k++)
71
        for (l = 0; l < 4; l++)
72
          fprintf (stderr, "A[%d][%d][%d][%d] = %d \n", i, j, k, l, A[i][j][k][l]);
73
 
74
  fprintf (stderr, "res = %d \n", res);
75
#endif
76
 
77
  if (res != 424)
78
    abort ();
79
 
80
  return 0;
81
}
82
 
83
/* Loops K and L should be interchanged.  */
84
/* { dg-final { scan-tree-dump-times "will be interchanged" 1 "graphite" { xfail *-*-* } } } */
85
/* { dg-final { cleanup-tree-dump "graphite" } } */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.