[lkml]   [2000]   [Aug]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: 64 bit divide/mod in 2.4.0-test5
Followup to:  <8mfjbs$5u9$>
By author: (Linus Torvalds)
In newsgroup:
> 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?


<> at work, <> in private!
"Unix gives you enough rope to shoot yourself in the foot."

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:58    [from the cache]
©2003-2014 Jasper Spaans. hosted at Digital Ocean