Linux Kernel
3.7.1
Main Page
Related Pages
Modules
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Groups
Pages
arch
mips
include
asm
arch_hweight.h
Go to the documentation of this file.
1
/*
2
* This file is subject to the terms and conditions of the GNU General Public
3
* License. See the file "COPYING" in the main directory of this archive
4
* for more details.
5
*
6
*/
7
#ifndef _ASM_ARCH_HWEIGHT_H
8
#define _ASM_ARCH_HWEIGHT_H
9
10
#ifdef ARCH_HAS_USABLE_BUILTIN_POPCOUNT
11
12
#include <asm/types.h>
13
14
static
inline
unsigned
int
__arch_hweight32(
unsigned
int
w
)
15
{
16
return
__builtin_popcount(w);
17
}
18
19
static
inline
unsigned
int
__arch_hweight16(
unsigned
int
w
)
20
{
21
return
__builtin_popcount(w & 0xffff);
22
}
23
24
static
inline
unsigned
int
__arch_hweight8(
unsigned
int
w
)
25
{
26
return
__builtin_popcount(w & 0xff);
27
}
28
29
static
inline
unsigned
long
__arch_hweight64(
__u64
w
)
30
{
31
return
__builtin_popcountll(w);
32
}
33
34
#else
35
#include <
asm-generic/bitops/arch_hweight.h
>
36
#endif
37
38
#endif
/* _ASM_ARCH_HWEIGHT_H */
Generated on Thu Jan 10 2013 13:09:32 for Linux Kernel by
1.8.2