blob: ddd048c0d825a0fd7597f2b82096f383368ff859 [file] [log] [blame]
Richard Henderson74fd1b62007-05-29 16:01:35 -07001/*
2 * arch/alpha/lib/fls.c
3 */
4
5#include <linux/module.h>
Jiri Slaby1977f032007-10-18 23:40:25 -07006#include <linux/bitops.h>
Richard Henderson74fd1b62007-05-29 16:01:35 -07007
8/* This is fls(x)-1, except zero is held to zero. This allows most
Lucas De Marchi25985ed2011-03-30 22:57:33 -03009 efficient input into extbl, plus it allows easy handling of fls(0)=0. */
Richard Henderson74fd1b62007-05-29 16:01:35 -070010
11const unsigned char __flsm1_tab[256] =
12{
13 0,
14 0,
15 1, 1,
16 2, 2, 2, 2,
17 3, 3, 3, 3, 3, 3, 3, 3,
18 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
19
20 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
21 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
22
23 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
24 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
25 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
26 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
27
28 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
29 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
30 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
31 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
32 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
33 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
34 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
35 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
36};
37
38EXPORT_SYMBOL(__flsm1_tab);