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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [debug/] [pr41264-1.c] - Blame information for rev 749

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

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

powered by: WebSVN 2.1.0

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