Pull cpuidle into release branch
[pandora-kernel.git] / arch / parisc / lib / libgcc / __clzsi2.c
1 #include "libgcc.h"
2
3 u32 __clzsi2(u32 v)
4 {
5         int p = 31;
6
7         if (v & 0xffff0000) {
8                 p -= 16;
9                 v >>= 16;
10         }
11         if (v & 0xff00) {
12                 p -= 8;
13                 v >>= 8;
14         }
15         if (v & 0xf0) {
16                 p -= 4;
17                 v >>= 4;
18         }
19         if (v & 0xc) {
20                 p -= 2;
21                 v >>= 2;
22         }
23         if (v & 0x2) {
24                 p -= 1;
25                 v >>= 1;
26         }
27
28         return p;
29 }
30 EXPORT_SYMBOL(__clzsi2);