Messages in this thread | | | From | (Linus Torvalds) | Subject | Re: 64 bit divide/mod in 2.4.0-test5 | Date | 4 Aug 2000 16:24:44 -0700 |
| |
In article <d3n1itxely.fsf@lxplus015.cern.ch>, Jes Sorensen <jes@linuxcare.com> wrote: > >Well you are seeing those because it's deprecated, you should use a >shift operator instead if in any way possible.
Indeed. Basically, I _know_ that I could include libgcc, but I also do not believe that people should get code that looks simple but takes hundreds of cycles to complete.
The fact that 64-bit divisions do not work naturally has actually saved us a number of times from people just not thinking about what an expensive operation such a division is - quite often there is a trivial shift that can do the same thing in two cycles or similar.
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..
Linus
- 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/
| |