OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.dg/] [debug/] [pr41264-1.c] - Blame information for rev 604

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

Line No. Rev Author Line
1 298 jeremybenn
/* { dg-do compile } */
2
 
3
#if (__SIZEOF_INT__ <= 2)       
4
typedef unsigned long hashval_t;
5
#else
6
typedef unsigned int hashval_t;
7
#endif
8
static hashval_t __attribute__((always_inline))
9
iterative_hash_host_wide_int (long val, hashval_t val2)
10
{
11
  hashval_t a = (hashval_t) val;
12
  int zero = 0;
13
  hashval_t b = (hashval_t) (val >> (sizeof (hashval_t) * 8 + zero));
14
 
15
  a -= b; a -= val2; a ^= (val2>>13);
16
  b -= val2; b -= a; b ^= (a<< 8);
17
  val2 -= a; val2 -= b; val2 ^= ((b&0xffffffff)>>13);
18
  a -= b; a -= val2; a ^= ((val2&0xffffffff)>>12);
19
  b -= val2; b -= a; b = (b ^ (a<<16)) & 0xffffffff;
20
  val2 -= a; val2 -= b; val2 = (val2 ^ (b>> 5)) & 0xffffffff;
21
  a -= b; a -= val2; a = (a ^ (val2>> 3)) & 0xffffffff;
22
  b -= val2; b -= a; b = (b ^ (a<<10)) & 0xffffffff;
23
  val2 -= a; val2 -= b; val2 = (val2 ^ (b>>15)) & 0xffffffff;
24
  return val2;
25
}
26
 
27
hashval_t
28
bla (int nunits, int mode)
29
{
30
  hashval_t hashcode = 0;
31
 
32
 
33
  hashcode = iterative_hash_host_wide_int (14, hashcode);
34
  hashcode = iterative_hash_host_wide_int (nunits, hashcode);
35
  hashcode = iterative_hash_host_wide_int (mode, hashcode);
36
  if (nunits)
37
    return 0;
38
  else
39
    return hashcode;
40
}

powered by: WebSVN 2.1.0

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