lkml.org 
[lkml]   [2007]   [Mar]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [RFC] div64_64 support
Date
On Tuesday 06 March 2007 14:34, Andi Kleen wrote:

> - return x;
> + int s;
> + u32 y;
> + u64 b;
> + u64 bs;
> +
> + y = 0;
> + for (s = 63; s >= 0; s -= 3) {
> + y = 2 * y;
> + b = 3 * y * (y+1) + 1;
> + bs = b << s;
> + if (x >= bs && (b == (bs>>s))) { /* avoid overflow */
> + x -= bs;
> + y++;
> + }
> + }
> + return y;
> }
>

Andi

<rant>
Let me see... You throw code like that and expect someone to actually
understand it in one year, and be able to correct a bug ?
</rant>

Please add something, an URL or even better a nice explanation, per favor...

Thank you
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-03-06 15:23    [W:0.108 / U:0.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site