3 ms·
> Example 2: Some (older, smaller) processors don't have an integer division instruction. Avoid division at all costs on these processors unless you are not wor
by Joeboy 13y ago
> Example 2: Some (older, smaller) processors don't have an integer division instruction. Avoid division at all costs on these processors unless you are not worried about space or execution speed.
Ok, so steer clear of division on ARM CPUs.
- zhemao 13y agoDepends on the ARM CPU. Some variants of ARMv7 architecture have an integer divide function. https://en.wikipedia.org/wiki/ARM_architecture#Arithmetic_instructions https://en.wikipedia.org/wiki/ARM_architecture#Arithmetic_in...
- __david__ 13y ago> 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.