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

powered by: WebSVN 2.1.0

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