<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/lib/div64.c, branch v2.6.19</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v2.6.19</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v2.6.19'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2003-10-26T06:27:04Z</updated>
<entry>
<title>[PATCH] fix __div64_32 to do division properly</title>
<updated>2003-10-26T06:27:04Z</updated>
<author>
<name>Randolph Chung</name>
<email>tausq@debian.org</email>
</author>
<published>2003-10-26T06:27:04Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=c2988baf02a8a29f0224115b10e575b826d5abcd'/>
<id>urn:sha1:c2988baf02a8a29f0224115b10e575b826d5abcd</id>
<content type='text'>
This fixes the generic __div64_32() to correctly handle divisions by
large 32-bit values (as used by nanosleep() and friends, for example).

It's a simple bit-at-a-time implementation with a reduction of the high
32-bits handled manually.  Architectures that can do 64/32-bit divisions
in hardware should implement their own more efficient versions.
</content>
</entry>
<entry>
<title>[PATCH] Fix problem introduced by do_div() patch</title>
<updated>2003-07-08T09:19:51Z</updated>
<author>
<name>Bernardo Innocenti</name>
<email>bernie@develer.com</email>
</author>
<published>2003-07-08T09:19:51Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=196652520859d6f3416790c2f81ce8f5c1262602'/>
<id>urn:sha1:196652520859d6f3416790c2f81ce8f5c1262602</id>
<content type='text'>
 - export the __div64_32 symbol for modules;

 - add likely() to the fast path (divisor&gt;&gt;32 == 0);

 - add __attribute__((pure)) to __div64_32() prototype so
   the compiler knows global memory isn't clobbered;

 - avoid building __div64_32() on 64bit architectures.
</content>
</entry>
<entry>
<title>[PATCH] Fix do_div() for all architectures</title>
<updated>2003-07-06T05:58:25Z</updated>
<author>
<name>Bernardo Innocenti</name>
<email>bernie@develer.com</email>
</author>
<published>2003-07-06T05:58:25Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=f0a8aa740a24500b3379396ace6737722d0de1d4'/>
<id>urn:sha1:f0a8aa740a24500b3379396ace6737722d0de1d4</id>
<content type='text'>
This offers a generic do_div64() that actually does the right thing,
unlike some architectures that "optimized" the 64-by-32 divide into
just a 32-bit divide.

Both ppc and sh were already providing an assembly optimized
__div64_32().  I called my function the same, so that their optimized
versions will automatically override mine in lib.a.

I've only tested extensively on m68knommu (uClinux) and made
sure generated code is reasonably short. Should be ok also on
parisc, since it's the same algorithm they were using before.

 - add generic C implementations of the do_div() for 32bit and 64bit
   archs in asm-generic/div64.h;

 - add generic library support function __div64_32() to handle the
   full 64/32 case on 32bit archs;

 - kill multiple copies of generic do_div() in architecture
   specific subdirs. Most copies were either buggy or not doing
   what they were supposed to do;

 - ensure all surviving instances of do_div() have their parameters
   correctly parenthesized to avoid funny side-effects;
</content>
</entry>
</feed>
