News for hackers. Stuff that matters.
Re:Efficient C Tip – use the modulus (%) operator with caution by georgecmu on Tuesday February 08, 2011 @09:28PM (#2195988)
No that isn’t a misprint. The ARM was nearly two orders of magnitude more cycle efficient than the MSP430 and AVR. Thus my claim that the modulus operator can be very inefficient is true for some architectures – but not all.

The first thing a real embedded guru would do is look at the assembly listing. My guess is that ARM actually provides operations for integer division and modulus, while for AVR they're implemented as low-level gcc library routines.

Re:Efficient C Tip – use the modulus (%) operator with caution by dumael on Tuesday February 08, 2011 @09:57PM (#2196056)
ARM doesn't provide modulus on any chips, division is available on ARM-7R and ARM-7M chips only.
Re:Efficient C Tip – use the modulus (%) operator with caution by georgecmu on Tuesday February 08, 2011 @09:58PM (#2196065)
Well, once you have division, modulus is one cycle away.