[PATCH V2] blackfin: optimize ffz, __ffs, ffs, __fls, and fls functions

2016-04-15 Thread zengzhaoxiu
From: Zhaoxiu Zeng blackfin has popcount instruction (ONES), we can do the efficient computing (ffz, __ffs, ffs, __fls, and fls) use this instruction. Adapted from "https://en.wikipedia.org/wiki/Find_first_set; and arch/ia64/include/asm/bitops.h. Changes to V1: - Use

[PATCH V2] blackfin: optimize ffz, __ffs, ffs, __fls, and fls functions

2016-04-15 Thread zengzhaoxiu
From: Zhaoxiu Zeng blackfin has popcount instruction (ONES), we can do the efficient computing (ffz, __ffs, ffs, __fls, and fls) use this instruction. Adapted from "https://en.wikipedia.org/wiki/Find_first_set; and arch/ia64/include/asm/bitops.h. Changes to V1: - Use hweight32 instead