Re:Dangerous Embedded C Coding Standard Rules (2011)
by zhemao on Monday December 30, 2013 @12:56PM
(#6985794)
Depends on the ARM CPU. Some variants of ARMv7 architecture have an integer divide function.
https://en.wikipedia.org/wiki/ARM_architecture#Arithmetic_in...
Re:Dangerous Embedded C Coding Standard Rules (2011)
by __david__ on Monday December 30, 2013 @06:29PM
(#6987830)
> Ok, so steer clear of division on ARM CPUs.
Don't ignore the last part of the sentence:
> …unless you are not worried about space or execution speed.
I'd argue that on ARMs you're generally not worried about execution speed (as most run pretty fast nowadays), nor space (RAMs and flashes generally have lots of space).
Now, do you have a really slow ARM, or are you running in a really constrained space (like a tiny metal-mask ROM)? Then yes, avoid it.
Ok, so steer clear of division on ARM CPUs.