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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [vect/] [costmodel/] [ppc/] [costmodel-slp-34.c] - Blame information for rev 689

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
struct mystr {
7
  int f1;
8
  int f2;
9
};
10
 
11
struct mystr af[16] = {
12
  10, 11, 12, 13, 14, 15, 16, 17,
13
  20, 21, 22, 23, 24, 25, 26, 27,
14
  30, 31, 32, 33, 34, 35, 36, 37,
15
  40, 41, 42, 43, 44, 45, 46, 47
16
};
17
 
18
struct mystr bf[16] = {
19
  12, 13, 14, 15, 16, 17, 18, 19,
20
  22, 23, 24, 25, 26, 27, 28, 29,
21
  32, 33, 34, 35, 36, 37, 38, 39,
22
  42, 43, 44, 45, 46, 47, 48, 49
23
};
24
 
25
struct mystr cf[16];
26
 
27
int res1[16] = {
28
  22, 26, 30, 34, 42, 46, 50, 54,
29
  62, 66, 70, 74, 82, 86, 90, 94,
30
};
31
 
32
int res2[16] = {
33
  24, 28, 32, 36, 44, 48, 52, 56,
34
  64, 68, 72, 76, 84, 88, 92, 96,
35
};
36
 
37
__attribute__ ((noinline)) void
38
foo (void)
39
{
40
  int i;
41
 
42
  for (i = 0; i < 16; i++)
43
  {
44
    cf[i].f1 = af[i].f1 + bf[i].f1;
45
    cf[i].f2 = af[i].f2 + bf[i].f2;
46
  }
47
}
48
 
49
 
50
 
51
int
52
main (void)
53
{
54
  int i;
55
 
56
  check_vect ();
57
  foo ();
58
 
59
  /* Check resiults. */
60
  for (i = 0; i < 16; i++)
61
    {
62
      if (cf[i].f1 != res1[i])
63
        abort ();
64
      if (cf[i].f2 != res2[i])
65
        abort ();
66
 
67
    }
68
  return 0;
69
}
70
 
71
/* { dg-final { scan-tree-dump-times "vectorization not profitable" 0 "vect" } } */
72
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
73
/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect"  } } */
74
/* { 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.