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/] [costmodel/] [x86_64/] [costmodel-vect-31.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 <stdarg.h>
4
#include "../../tree-vect.h"
5
 
6
#define N 32
7
 
8
struct t{
9
  int k[N];
10
  int l;
11
};
12
 
13
struct s{
14
  char a;       /* aligned */
15
  char b[N-1];  /* unaligned (offset 1B) */
16
  char c[N];    /* aligned (offset NB) */
17
  struct t d;   /* aligned (offset 2NB) */
18
  struct t e;   /* unaligned (offset 2N+4N+4 B) */
19
};
20
 
21
struct s tmp;
22
 
23
int main1 ()
24
{
25
  int i;
26
 
27
  /* unaligned */
28
  for (i = 0; i < N/2; i++)
29
    {
30
      tmp.b[i] = 5;
31
    }
32
 
33
  /* check results:  */
34
  for (i = 0; i <N/2; i++)
35
    {
36
      if (tmp.b[i] != 5)
37
        abort ();
38
    }
39
 
40
  /* aligned */
41
  for (i = 0; i < N/2; i++)
42
    {
43
      tmp.c[i] = 6;
44
    }
45
 
46
  /* check results:  */
47
  for (i = 0; i <N/2; i++)
48
    {
49
      if (tmp.c[i] != 6)
50
        abort ();
51
    }
52
 
53
  /* aligned */
54
  for (i = 0; i < N/2; i++)
55
    {
56
      tmp.d.k[i] = 7;
57
    }
58
 
59
  /* check results:  */
60
  for (i = 0; i <N/2; i++)
61
    {
62
      if (tmp.d.k[i] != 7)
63
        abort ();
64
    }
65
 
66
  /* unaligned */
67
  for (i = 0; i < N/2; i++)
68
    {
69
      tmp.e.k[i] = 8;
70
    }
71
 
72
  /* check results:  */
73
  for (i = 0; i <N/2; i++)
74
    {
75
      if (tmp.e.k[i] != 8)
76
        abort ();
77
    }
78
 
79
  return 0;
80
}
81
 
82
int main (void)
83
{
84
  check_vect ();
85
 
86
  return main1 ();
87
}
88
 
89
/* { dg-final { scan-tree-dump-times "vectorization not profitable" 1 "vect" } } */
90
/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" } } */
91
/* { 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.