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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.dg/] [vect/] [vect-65.c] - Blame information for rev 867

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

Line No. Rev Author Line
1 149 jeremybenn
/* { dg-require-effective-target vect_int } */
2
 
3
#include <stdarg.h>
4
#include "tree-vect.h"
5
 
6
#define N 16
7
#define M 4
8
 
9
int main1 ()
10
{
11
  int i, j;
12
  int ib[M][M][N] = {{{0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45},
13
                      {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45},
14
                      {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45},
15
                      {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}},
16
                     {{0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45},
17
                      {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45},
18
                      {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45},
19
                      {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}},
20
                     {{0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45},
21
                      {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45},
22
                      {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45},
23
                      {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}},
24
                     {{0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45},
25
                      {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45},
26
                      {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45},
27
                      {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}}};
28
  int ia[M][M][N];
29
  int ic[N];
30
 
31
  /* Multidimensional array. Aligned. The "inner" dimensions
32
     are invariant in the inner loop. Load and store. */
33
  for (i = 0; i < M; i++)
34
    {
35
      for (j = 0; j < N; j++)
36
        {
37
           ia[i][1][j] = ib[2][i][j];
38
        }
39
    }
40
 
41
  /* check results: */
42
  for (i = 0; i < M; i++)
43
    {
44
      for (j = 0; j < N; j++)
45
        {
46
           if (ia[i][1][j] != ib[2][i][j])
47
              abort();
48
        }
49
    }
50
 
51
  /* Multidimensional array. Aligned. The "inner" dimensions
52
     are invariant in the inner loop. Load. */
53
  for (i = 0; i < M; i++)
54
    {
55
      for (j = 0; j < N; j++)
56
        {
57
           ic[j] = ib[2][i][j];
58
        }
59
    }
60
 
61
  /* check results: */
62
  for (i = 0; i < M; i++)
63
    {
64
      for (j = 0; j < N; j++)
65
        {
66
           if (ic[j] != ib[2][i][j])
67
              abort();
68
        }
69
    }
70
 
71
  return 0;
72
}
73
 
74
int main (void)
75
{
76
  check_vect ();
77
 
78
  return main1 ();
79
}
80
 
81
/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" } } */
82
/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
83
/* { 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.