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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [vect/] [slp-4-big-array.c] - Blame information for rev 801

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

Line No. Rev Author Line
1 689 jeremybenn
/* { dg-require-effective-target vect_int } */
2
 
3
#include <stdarg.h>
4
#include "tree-vect.h"
5
 
6
#define N 128
7
volatile int y = 0;
8
 
9
int
10
main1 ()
11
{
12
  int i;
13
  unsigned short out[N*8];
14
  unsigned short in[N*8];
15
  unsigned int ia[N*2];
16
 
17
  for (i = 0; i < N*8; i++)
18
    {
19
      in[i] = i;
20
      if (y) /* Avoid vectorization.  */
21
        abort ();
22
    }
23
 
24
  for (i = 0; i < N; i++)
25
    {
26
      out[i*8] = in[i*8];
27
      out[i*8 + 1] = in[i*8 + 1];
28
      out[i*8 + 2] = in[i*8 + 2];
29
      out[i*8 + 3] = in[i*8 + 3];
30
      out[i*8 + 4] = in[i*8 + 4];
31
      out[i*8 + 5] = in[i*8 + 5];
32
      out[i*8 + 6] = in[i*8 + 6];
33
      out[i*8 + 7] = in[i*8 + 7];
34
 
35
      ia[i] = 7;
36
    }
37
 
38
  /* check results:  */
39
  for (i = 0; i < N; i++)
40
    {
41
      if (out[i*8] !=  in[i*8]
42
         || out[i*8 + 1] != in[i*8 + 1]
43
         || out[i*8 + 2] != in[i*8 + 2]
44
         || out[i*8 + 3] != in[i*8 + 3]
45
         || out[i*8 + 4] != in[i*8 + 4]
46
         || out[i*8 + 5] != in[i*8 + 5]
47
         || out[i*8 + 6] != in[i*8 + 6]
48
         || out[i*8 + 7] != in[i*8 + 7]
49
         || ia[i] != 7)
50
        abort ();
51
    }
52
 
53
  for (i = 0; i < N*2; i++)
54
    {
55
      out[i*4] = in[i*4];
56
      out[i*4 + 1] = in[i*4 + 1];
57
      out[i*4 + 2] = in[i*4 + 2];
58
      out[i*4 + 3] = in[i*4 + 3];
59
 
60
      ia[i] = 12;
61
    }
62
 
63
  /* check results:  */
64
  for (i = 0; i < N*2; i++)
65
    {
66
      if (out[i*4] !=  in[i*4]
67
         || out[i*4 + 1] != in[i*4 + 1]
68
         || out[i*4 + 2] != in[i*4 + 2]
69
         || out[i*4 + 3] != in[i*4 + 3]
70
         || ia[i] != 12)
71
        abort ();
72
    }
73
 
74
  for (i = 0; i < N/2; i++)
75
    {
76
      out[i*16] = in[i*16];
77
      out[i*16 + 1] = in[i*16 + 1];
78
      out[i*16 + 2] = in[i*16 + 2];
79
      out[i*16 + 3] = in[i*16 + 3];
80
      out[i*16 + 4] = in[i*16 + 4];
81
      out[i*16 + 5] = in[i*16 + 5];
82
      out[i*16 + 6] = in[i*16 + 6];
83
      out[i*16 + 7] = in[i*16 + 7];
84
      out[i*16 + 8] = in[i*16 + 8];
85
      out[i*16 + 9] = in[i*16 + 9];
86
      out[i*16 + 10] = in[i*16 + 10];
87
      out[i*16 + 11] = in[i*16 + 11];
88
      out[i*16 + 12] = in[i*16 + 12];
89
      out[i*16 + 13] = in[i*16 + 13];
90
      out[i*16 + 14] = in[i*16 + 14];
91
      out[i*16 + 15] = in[i*16 + 15];
92
 
93
      ia[i] = 21;
94
    }
95
 
96
  /* check results:  */
97
  for (i = 0; i < N/2; i++)
98
    {
99
      if (out[i*16] !=  in[i*16]
100
         || out[i*16 + 1] != in[i*16 + 1]
101
         || out[i*16 + 2] != in[i*16 + 2]
102
         || out[i*16 + 3] != in[i*16 + 3]
103
         || out[i*16 + 4] != in[i*16 + 4]
104
         || out[i*16 + 5] != in[i*16 + 5]
105
         || out[i*16 + 6] != in[i*16 + 6]
106
         || out[i*16 + 7] != in[i*16 + 7]
107
         || out[i*16 + 8] != in[i*16 + 8]
108
         || out[i*16 + 9] != in[i*16 + 9]
109
         || out[i*16 + 10] != in[i*16 + 10]
110
         || out[i*16 + 11] != in[i*16 + 11]
111
         || out[i*16 + 12] != in[i*16 + 12]
112
         || out[i*16 + 13] != in[i*16 + 13]
113
         || out[i*16 + 14] != in[i*16 + 14]
114
         || out[i*16 + 15] != in[i*16 + 15]
115
         || ia[i] != 21)
116
        abort ();
117
    }
118
 
119
 
120
  return 0;
121
}
122
 
123
int main (void)
124
{
125
  check_vect ();
126
 
127
  main1 ();
128
 
129
  return 0;
130
}
131
 
132
/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect"  } } */
133
/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 3 "vect"  } } */
134
/* { dg-final { cleanup-tree-dump "vect" } } */
135
 

powered by: WebSVN 2.1.0

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