LWN.net Logo

Question about Linus' QOTW

Question about Linus' QOTW

Posted Aug 25, 2011 15:40 UTC (Thu) by bronson (subscriber, #4806)
In reply to: Question about Linus' QOTW by pr1268
Parent article: Quotes of the week

Right. Instead of just switching to a 1-cycle bit shift, the author wrote a 64 bit do_div for 32 bit architectures that presumably takes ungodly cycles. Which, if I'm understanding correctly, is fairly insane.


(Log in to post comments)

Question about Linus' QOTW

Posted Aug 25, 2011 16:30 UTC (Thu) by hmh (subscriber, #3838) [Link]

Linus says this later (which I also consider QotW material):

Big 64-bit divides are bad bad bad. They are so horrendously bad on 32-bit that we don't even support them.

Which is in no way an overstatement of the badness, so I think you got it just right. It is ungodly expensive, indeed.

Question about Linus' QOTW

Posted Aug 25, 2011 17:51 UTC (Thu) by blitzkrieg3 (subscriber, #57873) [Link]

do_div was already there

http://lxr.linux.no/#linux+v3.0.3/arch/x86/include/asm/div64.h#L20

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds