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-66.c] - Blame information for rev 816

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