lkml.org 
[lkml]   [2000]   [Aug]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: 64 bit divide/mod in 2.4.0-test5
Date
Followup to:  <8mfjbs$5u9$1@penguin.transmeta.com>
By author: torvalds@transmeta.com (Linus Torvalds)
In newsgroup: linux.dev.kernel
>
> There's some special-case code in <asm/div64.h>, which is used mainly
> for printk(), but can be used for other stuff too: a 64-by-64 divide is
> usually much slower than a 64-by-32 divide which is actually the one
> that most people are looking for anyway (but gcc isn't clever enough to
> know this). That can be used if you _really_ think you need the divide.
> I've yet to see a real reason for it outside the printk() stuff..
>

There is also big difference on some architectures between 64/32 = 64
and 64/32 = 32 (the latter is a single, albeit slow, instruction on
x86.) I'm rather surprised gcc doesn't handle this -- it seems as an
obvious optimization.

Could we get the gcc people to look at this?

-hpa

--
<hpa@transmeta.com> at work, <hpa@zytor.com> in private!
"Unix gives you enough rope to shoot yourself in the foot."
http://www.zytor.com/~hpa/puzzle.txt

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

\
 
 \ /
  Last update: 2005-03-22 13:58    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site