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.target/] [i386/] [pr37101.c] - Blame information for rev 318

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 318 jeremybenn
/* { dg-do compile } */
2
/* { dg-options "-O2 -msse2 -ftree-vectorize -march=nocona" } */
3
/* { dg-require-effective-target sse2 } */
4
 
5
typedef __SIZE_TYPE__ size_t;
6
extern void *malloc (size_t);
7
extern void free (void *);
8
 
9
typedef struct _Resource
10
{
11
  struct _Resource *next;
12
  unsigned int id;
13
} ResourceRec, *ResourcePtr;
14
 
15
typedef struct _ClientResource
16
{
17
  ResourcePtr *resources;
18
  int elements;
19
  int buckets;
20
  int hashsize;
21
} ClientResourceRec;
22
 
23
static ClientResourceRec clientTable[256];
24
 
25
void
26
RebuildTable (int client)
27
{
28
  int j;
29
  ResourcePtr res, next;
30
  ResourcePtr **tails, *resources;
31
  ResourcePtr **tptr, *rptr;
32
 
33
  j = 2 * clientTable[client].buckets;
34
 
35
  tails =
36
    (ResourcePtr **) malloc ((unsigned long) (j * sizeof (ResourcePtr *)));
37
  resources =
38
    (ResourcePtr *) malloc ((unsigned long) (j * sizeof (ResourcePtr)));
39
 
40
  for (rptr = resources, tptr = tails; --j >= 0; rptr++, tptr++)
41
    {
42
      *rptr = ((ResourcePtr) ((void *) 0));
43
      *tptr = rptr;
44
    }
45
 
46
  clientTable[client].hashsize++;
47
  for (j = clientTable[client].buckets,
48
       rptr = clientTable[client].resources; --j >= 0; rptr++)
49
    {
50
      for (res = *rptr; res; res = next)
51
        {
52
          next = res->next;
53
          res->next = ((ResourcePtr) ((void *) 0));
54
          tptr = &tails[Hash (client, res->id)];
55
          **tptr = res;
56
          *tptr = &res->next;
57
        }
58
    }
59
  free ((void *) tails);
60
  clientTable[client].buckets *= 2;
61
  free ((void *) clientTable[client].resources);
62
  clientTable[client].resources = resources;
63
}
64
 
65
/* { dg-final { scan-assembler-not "movlps" } } */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.