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

Subversion Repositories openrisc

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

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 NMAX 2000
9
 
10
static int x1[NMAX], x2[NMAX], a[NMAX][NMAX], y1[NMAX], y2[NMAX];
11
 
12
static int __attribute__((noinline))
13
mvt (long N)
14
{
15
 
16
  int i,j;
17
 
18
  for (i = 0; i < N; i++)
19
    for (j = 0; j < N; j++)
20
      x1[i] = x1[i] + a[i][j] * y1[j];
21
 
22
  /* These two loops should be interchanged.  */
23
  for (i = 0; i < N; i++)
24
    for (j = 0; j < N; j++)
25
      x2[i] = x2[i] + a[j][i] * y2[j];
26
 
27
  return x1[0] + x2[0];
28
}
29
 
30
extern void abort ();
31
 
32
int
33
main (void)
34
{
35
  int i, j, res;
36
 
37
  for (i = 0; i < NMAX; i++)
38
    for (j = 0; j < NMAX; j++)
39
      a[i][j] = i + j;
40
 
41
  for (i = 0; i < NMAX; i++)
42
    {
43
      x1[i] = 0;
44
      x2[i] = 2*i;
45
      y1[i] = 100 - i;
46
      y2[i] = i;
47
    }
48
 
49
  res = mvt (NMAX);
50
 
51
#if DEBUG
52
  fprintf (stderr, "res = %d \n", res);
53
#endif
54
 
55
  if (res != 199900000)
56
    abort ();
57
 
58
  return 0;
59
}
60
 
61
/* PRE destroys the perfect nest and we can't cope with that yet.  */
62
/* { dg-final { scan-tree-dump-times "will be interchanged" 1 "graphite" } } */
63
/* { dg-final { cleanup-tree-dump "graphite" } } */
64
 

powered by: WebSVN 2.1.0

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