lkml.org 
[lkml]   [2016]   [Apr]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH V3] blackfin: optimize ffz, __ffs, ffs, __fls, and fls functions
From
Date
在 2016/4/16 0:08, Joe Perches 写道:
> On Fri, 2016-04-15 at 23:20 +0800, zengzhaoxiu@163.com wrote:
>> From: Zeng Zhaoxiu <zhaoxiu.zeng@gmail.com>
>>
>> blackfin has popcount instruction (ONES), we can do the efficient
>> computing (ffz, __ffs, ffs, __fls, and fls) use this instruction.
> []
>> diff --git a/arch/blackfin/include/asm/bitops.h b/arch/blackfin/include/asm/bitops.h
> []
>> +static inline unsigned int __arch_hweight64(__u64 w)
>> +{
>> + return __arch_hweight32((unsigned int)(w >> 32)) +
>> + __arch_hweight32((unsigned int)w);
>> +}
> trivia: perhaps this is more readable as:
>
> return __arch_hweight32(upper_32_bits(w)) +
> __arch_hweight32(lower_32_bits(w));
>
>

Yes.
I just moved these codes from the bottom of bitops.h, didn't change anything.


\
 
 \ /
  Last update: 2016-04-15 18:41    [W:0.053 / U:0.180 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site