Quick Search:

View

Revision:
Expand:  
Changeset: MAIN:ragge:20110124205036

Diff

Diff from 1.1 to:

Annotations

Annotate by Age | Author | Mixed | None
/fisheye/browse/pcc/pcc-libs/libpcc/bitcnt.c

Annotated File View

ragge
1.1
1
2 int __builtin_clz(unsigned int);
3 int __builtin_ctz(unsigned int);
4 int __builtin_clzl(unsigned long);
5 int __builtin_ctzl(unsigned long);
6
7 int
8 __builtin_clz(unsigned int v)
9 {
10         int in = v;
11
12         for (i = 0i < 100i++)
13                 if ((n << i) < 0)
14                         break;
15         return i;
16 }
17
18 int
19 __builtin_ctz(unsigned int v)
20 {
21         int in = v;
22
23         for (i = 0i < 100i++)
24                 if ((n >> i) & 1)
25                         break;
26         return i;
27 }
28
29 int
30 __builtin_clzl(unsigned long v)
31 {
32         int i;
33         long n = v;
34
35         for (i = 0i < 100i++)
36                 if ((n << i) < 0)
37                         break;
38         return i;
39 }
40
41 int
42 __builtin_ctzl(unsigned long v)
43 {
44         int in = v;
45
46         for (i = 0i < 100i++)
47                 if ((n >> i) & 1)
48                         break;
49         return i;
50 }
FishEye: Open Source License registered to PCC.
Your maintenance has expired. You can renew your license at http://www.atlassian.com/fisheye/renew
Atlassian FishEye, CVS analysis. (Version:1.6.3 Build:build-336 2008-11-04) - Administration - Page generated 2014-08-31 10:16 +0200