URL
https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 298 |
Rev 384 |
/* { dg-require-effective-target vect_int } */
|
/* { dg-require-effective-target vect_int } */
|
|
|
#include <stdio.h>
|
#include <stdio.h>
|
#include <stdarg.h>
|
#include <stdarg.h>
|
#include "tree-vect.h"
|
#include "tree-vect.h"
|
|
|
#define N 16
|
#define N 16
|
|
|
struct foostr {
|
struct foostr {
|
_Complex short f1;
|
_Complex short f1;
|
_Complex short f2;
|
_Complex short f2;
|
};
|
};
|
|
|
struct foostr a[16] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) =
|
struct foostr a[16] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) =
|
{
|
{
|
11 + 23i, 24 + 22i,
|
11 + 23i, 24 + 22i,
|
11 + 26i, 24 + 35i,
|
11 + 26i, 24 + 35i,
|
19 + 20i, 29 + 14i,
|
19 + 20i, 29 + 14i,
|
23 + 31i, 26 + 30i,
|
23 + 31i, 26 + 30i,
|
29 + 39i, 24 + 18i,
|
29 + 39i, 24 + 18i,
|
20 + 32i, 16 + 23i,
|
20 + 32i, 16 + 23i,
|
13 + 26i, 37 + 34i,
|
13 + 26i, 37 + 34i,
|
12 + 23i, 26 + 14i,
|
12 + 23i, 26 + 14i,
|
36 + 14i, 31 + 17i,
|
36 + 14i, 31 + 17i,
|
35 + 17i, 17 + 36i,
|
35 + 17i, 17 + 36i,
|
13 + 34i, 19 + 12i,
|
13 + 34i, 19 + 12i,
|
27 + 34i, 36 + 19i,
|
27 + 34i, 36 + 19i,
|
21 + 39i, 16 + 33i,
|
21 + 39i, 16 + 33i,
|
28 + 18i, 39 + 26i,
|
28 + 18i, 39 + 26i,
|
32 + 27i, 13 + 38i,
|
32 + 27i, 13 + 38i,
|
35 + 36i, 34 + 28i,
|
35 + 36i, 34 + 28i,
|
};
|
};
|
|
|
struct foostr b[16] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) =
|
struct foostr b[16] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) =
|
{
|
{
|
37 + 12i, 23 + 15i,
|
37 + 12i, 23 + 15i,
|
14 + 11i, 13 + 25i,
|
14 + 11i, 13 + 25i,
|
35 + 29i, 22 + 34i,
|
35 + 29i, 22 + 34i,
|
24 + 34i, 16 + 39i,
|
24 + 34i, 16 + 39i,
|
34 + 32i, 26 + 21i,
|
34 + 32i, 26 + 21i,
|
34 + 36i, 11 + 37i,
|
34 + 36i, 11 + 37i,
|
25 + 21i, 10 + 39i,
|
25 + 21i, 10 + 39i,
|
10 + 36i, 35 + 22i,
|
10 + 36i, 35 + 22i,
|
39 + 29i, 23 + 21i,
|
39 + 29i, 23 + 21i,
|
34 + 33i, 39 + 14i,
|
34 + 33i, 39 + 14i,
|
16 + 31i, 32 + 33i,
|
16 + 31i, 32 + 33i,
|
20 + 14i, 35 + 30i,
|
20 + 14i, 35 + 30i,
|
26 + 24i, 36 + 37i,
|
26 + 24i, 36 + 37i,
|
31 + 20i, 32 + 28i,
|
31 + 20i, 32 + 28i,
|
25 + 27i, 15 + 30i,
|
25 + 27i, 15 + 30i,
|
10 + 31i, 37 + 37i,
|
10 + 31i, 37 + 37i,
|
};
|
};
|
struct foostr c[16] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
|
struct foostr c[16] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
|
struct foostr res[N] =
|
struct foostr res[N] =
|
{
|
{
|
48 + 35i, 47 + 37i,
|
48 + 35i, 47 + 37i,
|
25 + 37i, 37 + 60i,
|
25 + 37i, 37 + 60i,
|
54 + 49i, 51 + 48i,
|
54 + 49i, 51 + 48i,
|
47 + 65i, 42 + 69i,
|
47 + 65i, 42 + 69i,
|
63 + 71i, 50 + 39i,
|
63 + 71i, 50 + 39i,
|
54 + 68i, 27 + 60i,
|
54 + 68i, 27 + 60i,
|
38 + 47i, 47 + 73i,
|
38 + 47i, 47 + 73i,
|
22 + 59i, 61 + 36i,
|
22 + 59i, 61 + 36i,
|
75 + 43i, 54 + 38i,
|
75 + 43i, 54 + 38i,
|
69 + 50i, 56 + 50i,
|
69 + 50i, 56 + 50i,
|
29 + 65i, 51 + 45i,
|
29 + 65i, 51 + 45i,
|
47 + 48i, 71 + 49i,
|
47 + 48i, 71 + 49i,
|
47 + 63i, 52 + 70i,
|
47 + 63i, 52 + 70i,
|
59 + 38i, 71 + 54i,
|
59 + 38i, 71 + 54i,
|
57 + 54i, 28 + 68i,
|
57 + 54i, 28 + 68i,
|
45 + 67i, 71 + 65i,
|
45 + 67i, 71 + 65i,
|
};
|
};
|
|
|
__attribute__ ((noinline)) void
|
__attribute__ ((noinline)) void
|
foo (void)
|
foo (void)
|
{
|
{
|
int i;
|
int i;
|
|
|
for (i = 0; i < N; i++)
|
for (i = 0; i < N; i++)
|
{
|
{
|
c[i].f1 = a[i].f1 + b[i].f1;
|
c[i].f1 = a[i].f1 + b[i].f1;
|
c[i].f2 = a[i].f2 + b[i].f2;
|
c[i].f2 = a[i].f2 + b[i].f2;
|
}
|
}
|
|
|
}
|
}
|
|
|
int
|
int
|
main (void)
|
main (void)
|
{
|
{
|
int i;
|
int i;
|
check_vect ();
|
check_vect ();
|
|
|
foo ();
|
foo ();
|
|
|
/* check results: */
|
/* check results: */
|
for (i = 0; i < N; i++)
|
for (i = 0; i < N; i++)
|
{
|
{
|
if (c[i].f1 != res[i].f1)
|
if (c[i].f1 != res[i].f1)
|
abort ();
|
abort ();
|
if (c[i].f2 != res[i].f2)
|
if (c[i].f2 != res[i].f2)
|
abort ();
|
abort ();
|
}
|
}
|
|
|
return 0;
|
return 0;
|
}
|
}
|
|
|
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
|
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
|
/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" } } */
|
/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" } } */
|
/* { dg-final { cleanup-tree-dump "vect" } } */
|
/* { dg-final { cleanup-tree-dump "vect" } } */
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.