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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.dg/] [vect/] [pr25413a.c] - Blame information for rev 154

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
/* { dg-require-effective-target vect_double } */
2
 
3
#include "tree-vect.h"
4
 
5
#define N 8
6
 
7
typedef __SIZE_TYPE__ size_t;
8
 
9
extern void *malloc (size_t __size) __attribute__ ((__nothrow__,
10
                                                    __malloc__));
11
 
12
typedef double num_t;
13
static const num_t num__infty = ((num_t)1.0)/((num_t)0.0);
14
 
15
struct oct_tt;
16
typedef struct oct_tt oct_t;
17
 
18
typedef unsigned int var_t;
19
typedef enum {
20
  OCT_EMPTY = 0,
21
  OCT_NORMAL = 1,
22
  OCT_CLOSED = 2
23
} oct_state;
24
 
25
struct oct_tt {
26
  var_t n;
27
 
28
  int ref;
29
 
30
  oct_state state;
31
  struct oct_tt* closed;
32
 
33
  num_t* c;
34
};
35
 
36
void* octfapg_mm_malloc (size_t t);
37
oct_t* octfapg_alloc (var_t n);
38
oct_t* octfapg_full_copy (oct_t* m);
39
 
40
struct mmalloc_tt;
41
typedef struct mmalloc_tt mmalloc_t;
42
 
43
struct mmalloc_tt
44
{
45
  int id;
46
 
47
  int nb_alloc;
48
  int nb_realloc;
49
  int nb_free;
50
 
51
  size_t rem;
52
  size_t max;
53
  size_t tot;
54
 
55
};
56
 
57
typedef struct
58
{
59
  size_t size;
60
 
61
  mmalloc_t* mm;
62
  int id;
63
 
64
  double dummy;
65
 
66
} mmheader_t;
67
 
68
void*
69
octfapg_mm_malloc (size_t t)
70
{
71
  char* m = (char*)malloc(t+sizeof(mmheader_t));
72
  return m+sizeof(mmheader_t);
73
}
74
 
75
oct_t* octfapg_empty (var_t n);
76
 
77
oct_t*
78
octfapg_empty (const var_t n)
79
{
80
  oct_t* m;
81
  /*octfapg_timing_enter("oct_empty",3);*/
82
  m = ((oct_t*) octfapg_mm_malloc (sizeof(oct_t)));
83
  m->n = n;
84
  m->ref = 1;
85
  m->state = OCT_EMPTY;
86
  m->closed = (oct_t*)((void *)0);
87
  m->c = (num_t*)((void *)0);
88
  /*octfapg_timing_exit("oct_empty",3);*/
89
  return m;
90
}
91
 
92
oct_t*
93
octfapg_alloc (const var_t n)
94
{
95
  size_t nn = (2*(size_t)(n)*((size_t)(n)+1));
96
  oct_t* m;
97
  m = octfapg_empty(n);
98
  m->c = ((num_t*) octfapg_mm_malloc (sizeof(num_t)*(nn)));
99
  ;
100
  m->state = OCT_NORMAL;
101
  m->closed = (oct_t*)((void *)0);
102
  return m;
103
}
104
 
105
oct_t*
106
octfapg_universe (const var_t n)
107
{
108
  oct_t* m;
109
  size_t i, nn = (2*(size_t)(n)*((size_t)(n)+1));
110
  m = octfapg_alloc(n);
111
  for (i=0;i<nn;i++) *(m->c+i) = num__infty;
112
  for (i=0;i<2*n;i++) *(m->c+((size_t)(i)+(((size_t)(i)+1)*((size_t)(i)+1))/2)) = (num_t)(0);
113
  m->state = OCT_CLOSED;
114
  return m;
115
}
116
 
117
int main (void)
118
{
119
  int i;
120
  check_vect ();
121
 
122
  oct_t *p = octfapg_universe(10);
123
  return 0;
124
}
125
 
126
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
127
/* { dg-final { scan-tree-dump-times "vector alignment may not be reachable" 1 "vect" { target { ! vect_aligned_arrays  } } } } */
128
/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" { target { ! vect_aligned_arrays } } } } */
129
/* { 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.