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 Wed, 7 Mar 2007 00:24:35 +0200
Sami Farin <7atbggg02@sneakemail.com> wrote:

> On Tue, Mar 06, 2007 at 23:53:49 +0200, Sami Farin wrote:
> ...
> > And I found bug in gcc-4.1.2, it gave 0 for ncubic results
> > when doing 1000 loops test... gcc-4.0.3 works.
>
> Found it.
>
> --- cbrt-test.c~ 2007-03-07 00:20:54.735248105 +0200
> +++ cbrt-test.c 2007-03-07 00:21:03.964864343 +0200
> @@ -209,7 +209,7 @@
>
> __asm__("bsrl %1,%0\n\t"
> "cmovzl %2,%0"
> - : "=&r" (r) : "rm" (x), "rm" (-1));
> + : "=&r" (r) : "rm" (x), "rm" (-1) : "memory");
> return r+1;
> }
>
> Now Linux 2.6 does not have "memory" in fls, maybe it causes
> some gcc funnies some people are seeing.
>

That code was copy-paste from:
include/asm-x86_64/bitops.h

So shouldn't both fls() and ffs() be fixed there as well?

--
Stephen Hemminger <shemminger@linux-foundation.org>
-
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-07 01:05    [W:0.264 / U:0.336 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site