Path: blob/master/arch/mips/include/asm/arch_hweight.h
17467 views
/*1* This file is subject to the terms and conditions of the GNU General Public2* License. See the file "COPYING" in the main directory of this archive3* for more details.4*5*/6#ifndef _ASM_ARCH_HWEIGHT_H7#define _ASM_ARCH_HWEIGHT_H89#ifdef ARCH_HAS_USABLE_BUILTIN_POPCOUNT1011#include <asm/types.h>1213static inline unsigned int __arch_hweight32(unsigned int w)14{15return __builtin_popcount(w);16}1718static inline unsigned int __arch_hweight16(unsigned int w)19{20return __builtin_popcount(w & 0xffff);21}2223static inline unsigned int __arch_hweight8(unsigned int w)24{25return __builtin_popcount(w & 0xff);26}2728static inline unsigned long __arch_hweight64(__u64 w)29{30return __builtin_popcountll(w);31}3233#else34#include <asm-generic/bitops/arch_hweight.h>35#endif3637#endif /* _ASM_ARCH_HWEIGHT_H */383940