[prev in list] [next in list] [prev in thread] [next in thread]
List: linux-kernel
Subject: Re: [PATCHSET][2.6-test4][0/6]Support for HPET based timer - Take
From: Linus Torvalds <torvalds () osdl ! org>
Date: 2003-08-31 22:48:19
[Download RAW message or body]
On Sun, 31 Aug 2003, Erik Andersen wrote:
>
> Been there done that, got the scars to prove it. do_div() is a
> macro that acts sortof like the ISO C99 lldiv(3) function.
No.
You missed a very important part of do_div() - it has _totally_ different
numerical range than a regular /, % or lldiv() call.
All of /, % and lldiv() work on 64-bit numbers. do_div() DOES NOT!
do_div() very much is all about:
*** 32-bit divisor ***
which also implies that the remainder is 32-bit.
And the fact is, such a division is a lot faster than a full 64-bit
division. On a _lot_ of architectures, but notably so on x86.
It is _not_ a 64-bit divide, and that's not only important, it's the
whole _reason_d'etre_ for the whole function. See?
So by continually confusing it with a 64-bit divide (either by confusing
it with lldiv() or those horrible gcc internal __{div|mod}di3u things),
you miss the whole point of the function.
Linus
-
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/
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic