[lkml]   [2008]   [Apr]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] x86: generic versions of find_first_(zero_)bit, convert i386

On Sun, 6 Apr 2008 13:22:58 -0700 (PDT), "dean gaudet" <>
> On Sun, 6 Apr 2008, Alexander van Heukelum wrote:
> > The current generic implementation of ffz is O(lg(n)) already
> it's O(lg(n)) time... the operations all depend on each other.
> the implementation i pointed to is O(lg(n)) code space... and the time
> depends on how parallel the machine is, they're not dependent on each
> other.

Indeed. The worst dependencies are in the sum of all the partial
results in this implementation. And addition is associative, so
partial results can be written as ((a+b)+(c+d))+(e+f). Assuming
perfect parallel execution this would lead to O(ln(ln(n))). Good.

Care to implement ffs and __ffs like this?


> -dean
Alexander van Heukelum

-- - The professional email service

 \ /
  Last update: 2008-04-07 12:29    [W:0.082 / U:3.140 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site