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-64.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_int } */
2
 
3
#include <stdarg.h>
4
#include "tree-vect.h"
5
 
6
#define N 16
7
 
8
int ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
9
 
10
__attribute__ ((noinline))
11
int main1 ()
12
{
13
  int i, j;
14
  int ia[N][4][N+1];
15
  int ic[N][N][3][13];
16
  int id[N][N][N];
17
 
18
  /* Multidimensional array. Not aligned: vectorizable. */
19
  for (i = 0; i < N; i++)
20
    {
21
      for (j = 0; j < N; j++)
22
        {
23
           ia[i][1][j] = ib[i];
24
        }
25
    }
26
 
27
  /* Multidimensional array. Aligned: vectorizable. */
28
  for (i = 0; i < N; i++)
29
    {
30
      for (j = 0; j < N; j++)
31
        {
32
           ic[i][1][1][j] = ib[i];
33
        }
34
    }
35
 
36
  /* Multidimensional array. Not aligned: vectorizable. */
37
  for (i = 0; i < N; i++)
38
    {
39
      for (j = 0; j < N; j++)
40
        {
41
           id[i][1][j+1] = ib[i];
42
        }
43
    }
44
 
45
  /* check results: */
46
  for (i = 0; i < N; i++)
47
    {
48
      for (j = 0; j < N; j++)
49
        {
50
           if (ia[i][1][j] != ib[i])
51
              abort();
52
        }
53
    }
54
 
55
  /* check results: */
56
  for (i = 0; i < N; i++)
57
    {
58
      for (j = 0; j < N; j++)
59
        {
60
           if (ic[i][1][1][j] != ib[i])
61
              abort();
62
        }
63
    }
64
 
65
  /* check results: */
66
  for (i = 0; i < N; i++)
67
    {
68
      for (j = 0; j < N; j++)
69
        {
70
           if (id[i][1][j+1] != ib[i])
71
              abort();
72
        }
73
    }
74
 
75
  return 0;
76
}
77
 
78
int main (void)
79
{
80
  check_vect ();
81
 
82
  return main1 ();
83
}
84
 
85
/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" } } */
86
/* { 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.