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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [vect/] [vect-22.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
/* { dg-require-effective-target vect_float } */
3
 
4
#include <stdarg.h>
5
#include "tree-vect.h"
6
 
7
#define N 64
8
 
9
  int ia[N];
10
  int ib[N]=
11
    {1,1,0,0,1,0,1,0,
12
     1,1,0,0,1,0,1,0,
13
     1,1,0,0,1,0,1,0,
14
     1,1,0,0,1,0,1,0,
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
 
20
  signed char ca[N];
21
  signed char cb[N] =
22
    {1,1,0,0,1,0,1,0,
23
     1,1,0,0,1,0,1,0,
24
     1,1,0,0,1,0,1,0,
25
     1,1,0,0,1,0,1,0,
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
 
31
  short sa[N];
32
  short sb[N] =
33
    {1,1,0,0,1,0,1,0,
34
     1,1,0,0,1,0,1,0,
35
     1,1,0,0,1,0,1,0,
36
     1,1,0,0,1,0,1,0,
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
 
42
  float fa[N];
43
  float fb[N] =
44
    {1,1,0,0,1,0,1,0,
45
     1,1,0,0,1,0,1,0,
46
     1,1,0,0,1,0,1,0,
47
     1,1,0,0,1,0,1,0,
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
 
53
__attribute__ ((noinline)) int
54
main1 ()
55
{
56
  int i;
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.