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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [graphite/] [interchange-12.c] - Blame information for rev 749

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 689 jeremybenn
/* { dg-require-effective-target size32plus } */
2
 
3
#define DEBUG 0
4
#if DEBUG
5
#include <stdio.h>
6
#endif
7
 
8
#define N 200
9
 
10
int A[N][N], B[N][N], C[N][N];
11
 
12
static int __attribute__((noinline))
13
matmult (void)
14
{
15
  int i, j, k;
16
 
17
  /* Loops J and K should be interchanged.  */
18
  for (i = 0; i < N; i++)
19
    for (j = 0; j < N; j++)
20
      {
21
        A[i][j] = 0;
22
        for (k = 0; k < N; k++)
23
          A[i][j] += B[i][k] * C[k][j];
24
      }
25
 
26
  return A[0][0] + A[N-1][N-1];
27
}
28
 
29
extern void abort ();
30
 
31
int
32
main (void)
33
{
34
  int i, j, res;
35
 
36
  for (i = 0; i < N; i++)
37
    for (j = 0; j < N; j++)
38
      {
39
        A[i][j] = 0;
40
        B[i][j] = i - j;
41
        C[i][j] = i + j;
42
      }
43
 
44
  res = matmult ();
45
 
46
#if DEBUG
47
  fprintf (stderr, "res = %d \n", res);
48
#endif
49
 
50
  if (res != 2626800)
51
    abort ();
52
 
53
  return 0;
54
}
55
 
56
/* { dg-final { scan-tree-dump-times "will be interchanged" 1 "graphite" } } */
57
/* { 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.