4.12. Selecting real-time division

The division helper routine supplied with the ARM libraries provides good overall performance. However, the amount of time required to perform a division depends on the input values. A 4-bit quotient requires only 12 cycles, but a 32-bit quotient requires 96 cycles. Some applications require a faster worst-case cycle count at the expense of lower average performance. For this reason, two divide routines are provided with the ARM library.

The real-time routine:

Select the real-time divide routine, instead of the generally more efficient routine, by using either:


Because it uses the CLZ instruction and the DSP multiplies, the real-time division routine only works on ARM architecture v5TE and above. If you reference __use_realtime_division and compile and link for a core that does not support these, the linker displays an error similar to:

Error: L6218E: Undefined symbol
(referred from myobj.o)
Copyright © 1999-2001 ARM Limited. All rights reserved.ARM DUI 0067D