> -----Original Message----- > From: avr-libc-dev-bounces+eric.weddington=atmel....@nongnu.org > [mailto:avr-libc-dev-bounces+eric.weddington=atmel....@nongnu.org] On > Behalf Of Ambroz Bizjak > Sent: Friday, June 07, 2013 8:34 PM > To: avr-libc-dev@nongnu.org > Subject: [avr-libc-dev] Faster integer division > > Hi! > > I've found 32bit integer division in gcc too slow, and I managed to > implement division in asm that's faster than what gcc 4.8 produces at > -O4, about 2/3 the time (but I'm not sure if any of this is due to > inlining). The algorithm is restoring division but unrolled and > heavily optimized. Could this get in gcc or avr-libc, wherever the > right place is? >
Hi Ambroz, What's difficult is to balance different needs of different users. For the most part, and there are always exceptions to this, most of the AVR GCC users are interested in code size, rather than speed. They would rather see the smallest way to do division, even if it is slower. But I also recognize that there are definitely times where speed is the most desired. So given that, where do you think it best for your algorithm to generated? Should it be generated at a specific optimization level in gcc? Should it be a specialized inline-assembly function call in avr-libc that is specifically called by the user? You said that it's faster than what gcc produces about 2/3 of the time, but you're not sure if that is due to inlining. Can you do some further testing to see if it's due to inlining? Or whether it's because your algorithm is better? This is important to know, to see if it's worth the time and effort to get it in gcc or avr-libc. Thanks, Eric _______________________________________________ AVR-libc-dev mailing list AVR-libc-dev@nongnu.org https://lists.nongnu.org/mailman/listinfo/avr-libc-dev