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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [vect/] [slp-1.c] - Blame information for rev 705

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

powered by: WebSVN 2.1.0

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