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/] [vect/] [vect-nest-cycle-3.c] - Blame information for rev 298

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 298 jeremybenn
/* { dg-require-effective-target vect_float } */
2
 
3
#include <stdarg.h>
4
#include <stdio.h>
5
#include "tree-vect.h"
6
 
7
#define N 16
8
#define DIFF 82
9
 
10
float c[N][N], b[N][N], a[N];
11
 
12
__attribute__ ((noinline)) int
13
main1 ()
14
{
15
  int i, j;
16
  float diff;
17
 
18
  /* In inner loop vectorization -funsafe-math-optimizations is needed to
19
     vectorize the summation. But in outer loop vectorization the order of
20
     calculation doesn't change, therefore, there is no need in that flag.  */
21
  for (i = 0; i < N; i++)
22
    {
23
      diff = 2;
24
      for (j = 0; j < N; j++)
25
        diff += (b[j][i] - c[j][i]);
26
 
27
      a[i] = diff;
28
    }
29
 
30
  /* Check results:  */
31
  for (i = 0; i < N; i++)
32
    if (a[i] != DIFF)
33
      abort ();
34
 
35
  return 0;
36
}
37
 
38
int main (void)
39
{
40
  int i, j;
41
 
42
  check_vect ();
43
 
44
  for (i = 0; i < N; i++)
45
    for (j = 0; j < N; j++)
46
      {
47
        b[i][j] = i+j+5;
48
        c[i][j] = i+j;
49
      }
50
 
51
  main1 ();
52
 
53
  return 0;
54
}
55
 
56
/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" } } */
57
/* { dg-final { cleanup-tree-dump "vect" } } */

powered by: WebSVN 2.1.0

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