blob: 02e156776645d556433ade0dd05046adfcd5edca [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001// SPDX-License-Identifier: GPL-2.0
Richard Henderson74fd1b62007-05-29 16:01:35 -07002/*
3 * arch/alpha/lib/fls.c
4 */
5
6#include <linux/module.h>
Jiri Slaby1977f032007-10-18 23:40:25 -07007#include <linux/bitops.h>
Richard Henderson74fd1b62007-05-29 16:01:35 -07008
9/* This is fls(x)-1, except zero is held to zero. This allows most
Lucas De Marchi25985ed2011-03-30 22:57:33 -030010 efficient input into extbl, plus it allows easy handling of fls(0)=0. */
Richard Henderson74fd1b62007-05-29 16:01:35 -070011
12const unsigned char __flsm1_tab[256] =
13{
14 0,
15 0,
16 1, 1,
17 2, 2, 2, 2,
18 3, 3, 3, 3, 3, 3, 3, 3,
19 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
20
21 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
22 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
23
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 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
28
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 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
37};
38
39EXPORT_SYMBOL(__flsm1_tab);