Root/
Source at commit 1158 created 13 years 16 days ago. By azimutz, Match nvidia.c with the one on my branch (Chazi) adding dev id's from issue 99 and Asus G74SX (0DF4, 1251). | |
---|---|
1 | /*␊ |
2 | * libgcc/__clzsi2.c␊ |
3 | *␊ |
4 | * Returns the leading number of 0 bits in the argument␊ |
5 | */␊ |
6 | ␊ |
7 | #include <stdint.h>␊ |
8 | #include <stddef.h>␊ |
9 | ␊ |
10 | uint32_t __clzsi2(uint32_t v)␊ |
11 | {␊ |
12 | ␉int p = 31;␊ |
13 | ␊ |
14 | ␉if (v & 0xffff0000) {␊ |
15 | ␉␉p -= 16;␊ |
16 | ␉␉v >>= 16;␊ |
17 | ␉}␊ |
18 | ␉if (v & 0xff00) {␊ |
19 | ␉␉p -= 8;␊ |
20 | ␉␉v >>= 8;␊ |
21 | ␉}␊ |
22 | ␉if (v & 0xf0) {␊ |
23 | ␉␉p -= 4;␊ |
24 | ␉␉v >>= 4;␊ |
25 | ␉}␊ |
26 | ␉if (v & 0xc) {␊ |
27 | ␉␉p -= 2;␊ |
28 | ␉␉v >>= 2;␊ |
29 | ␉}␊ |
30 | ␉if (v & 0x2) {␊ |
31 | ␉␉p -= 1;␊ |
32 | ␉␉v >>= 1;␊ |
33 | ␉}␊ |
34 | ␊ |
35 | ␉return p;␊ |
36 | }␊ |
37 |