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-22.c] - Blame information for rev 867

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