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/] [vect-complex-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 <stdio.h>
4
#include <stdarg.h>
5
#include "tree-vect.h"
6
 
7
#define N 16
8
 
9
struct foostr {
10
  _Complex short f1;
11
  _Complex short f2;
12
};
13
 
14
struct foostr a[16] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) =
15
  {
16
    11 + 23i, 24 + 22i,
17
    11 + 26i, 24 + 35i,
18
    19 + 20i, 29 + 14i,
19
    23 + 31i, 26 + 30i,
20
    29 + 39i, 24 + 18i,
21
    20 + 32i, 16 + 23i,
22
    13 + 26i, 37 + 34i,
23
    12 + 23i, 26 + 14i,
24
    36 + 14i, 31 + 17i,
25
    35 + 17i, 17 + 36i,
26
    13 + 34i, 19 + 12i,
27
    27 + 34i, 36 + 19i,
28
    21 + 39i, 16 + 33i,
29
    28 + 18i, 39 + 26i,
30
    32 + 27i, 13 + 38i,
31
    35 + 36i, 34 + 28i,
32
  };
33
 
34
struct foostr b[16] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) =
35
  {
36
    37 + 12i, 23 + 15i,
37
    14 + 11i, 13 + 25i,
38
    35 + 29i, 22 + 34i,
39
    24 + 34i, 16 + 39i,
40
    34 + 32i, 26 + 21i,
41
    34 + 36i, 11 + 37i,
42
    25 + 21i, 10 + 39i,
43
    10 + 36i, 35 + 22i,
44
    39 + 29i, 23 + 21i,
45
    34 + 33i, 39 + 14i,
46
    16 + 31i, 32 + 33i,
47
    20 + 14i, 35 + 30i,
48
    26 + 24i, 36 + 37i,
49
    31 + 20i, 32 + 28i,
50
    25 + 27i, 15 + 30i,
51
    10 + 31i, 37 + 37i,
52
  };
53
struct foostr c[16] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
54
struct foostr res[N] =
55
  {
56
    48 + 35i, 47 + 37i,
57
    25 + 37i, 37 + 60i,
58
    54 + 49i, 51 + 48i,
59
    47 + 65i, 42 + 69i,
60
    63 + 71i, 50 + 39i,
61
    54 + 68i, 27 + 60i,
62
    38 + 47i, 47 + 73i,
63
    22 + 59i, 61 + 36i,
64
    75 + 43i, 54 + 38i,
65
    69 + 50i, 56 + 50i,
66
    29 + 65i, 51 + 45i,
67
    47 + 48i, 71 + 49i,
68
    47 + 63i, 52 + 70i,
69
    59 + 38i, 71 + 54i,
70
    57 + 54i, 28 + 68i,
71
    45 + 67i, 71 + 65i,
72
  };
73
 
74
__attribute__ ((noinline)) void
75
foo (void)
76
{
77
  int i;
78
 
79
  for (i = 0; i < N; i++)
80
    {
81
      c[i].f1 = a[i].f1 + b[i].f1;
82
      c[i].f2 = a[i].f2 + b[i].f2;
83
    }
84
 
85
}
86
 
87
int
88
main (void)
89
{
90
  int i;
91
  check_vect ();
92
 
93
  foo ();
94
 
95
  /* check results:  */
96
  for (i = 0; i < N; i++)
97
    {
98
      if (c[i].f1 != res[i].f1)
99
        abort ();
100
      if (c[i].f2 != res[i].f2)
101
        abort ();
102
    }
103
 
104
  return 0;
105
}
106
 
107
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
108
/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" } } */
109
/* { 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.