lkml.org 
[lkml]   [2003]   [Mar]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Runaway cron task on 2.5.63/4 bk?
Andrew Morton wrote:
> > However, gcc is unable to do-the-right-thing and generate 32x32->64
> > multiplies, or 32x64->64 multiplies, even though those are both a _lot_
> > faster than the full 64x64->64 case.
>
> 2.95.3 and 3.2.1 seem to do it right?
>
> long a;
> long b;
> long long c;
>
> void foo(void)
> {
> c = a * b;
> }

Your code is wrong for this test. It does a 32x32->32 multiply, and
then sign extends the result to 64 bits.

The correct test has "c = (long long) a * b;".

-- Jamie

-
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: 2005-03-22 13:33    [W:0.061 / U:0.520 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site