lkml.org 
[lkml]   [2015]   [Feb]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 1/3] lib: find_*_bit reimplementation
Rasmus Villemoes <linux@rasmusvillemoes.dk> wrote:
> ... and this be part of _find_next_bit? Can find_next_bit not be simply
> 'return _find_next_bit(addr, size, offset, 1);', and similarly for
> find_next_zero_bit? Btw., passing true and false for the boolean
> parameter may be a little clearer.

Looking at the generated code, it would be better to replace the boolean
parameter with 0ul or ~0ul and XOR with it. The same number of registers,
and saves a conditional branch.

(I was hoping GCC would figure that trick out, but it didn't.)


\
 
 \ /
  Last update: 2015-02-02 13:01    [W:0.115 / U:0.340 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site