/* * linux/arch/unicore32/include/asm/bitops.h * * Code specific to PKUnity SoC and UniCore ISA * * Copyright (C) 2001-2010 GUAN Xue-tao * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ #ifndef __UNICORE_BITOPS_H__ #define __UNICORE_BITOPS_H__ #define _ASM_GENERIC_BITOPS_FLS_H_ #define _ASM_GENERIC_BITOPS___FLS_H_ #define _ASM_GENERIC_BITOPS_FFS_H_ #define _ASM_GENERIC_BITOPS___FFS_H_ /* * On UNICORE, those functions can be implemented around * the cntlz instruction for much better code efficiency. */
static inline int fls(int x) { int ret; asm("cntlz\t%0, %1" : "=r" (ret) : "r" (x) : "cc"); ret = 32 - ret; return ret; }Contributors
Person | Tokens | Prop | Commits | CommitProp |
Guan Xuetao | 23 | 100.00% | 1 | 100.00% |
Total | 23 | 100.00% | 1 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp |
Guan Xuetao | 87 | 100.00% | 2 | 100.00% |
Total | 87 | 100.00% | 2 | 100.00% |