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-64.c] - Blame information for rev 154

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