Tool/software: TI C/C++ Compiler
Hi TI team,
I had to look a bit deeper to the division implementation within the ARM 18.12.0 compiler and the corresponding runtime library and found the following behavior:
- 16-bit division is done by embedded call of SDIV
- 16-bit modulo division is done by helper-function __aeabi_idivmod
- 32-bit division is done by embedded call of UDIV / SDIV
- 32-bit modulo division is done by helper-functions __aeabi_uidivmod / __aeabi_idivmod
- 64-bit division is done by by helper-functions __aeabi_uldivmod / __aeabi_ldivmod
- 64-bit modulo division is done by helper-functions __aeabi_uldivmod / __aeabi_ldivmod
I found it not very consistent for case when dividend and/or divisor is equal to 0.
UDIV/SDIV returns 0 in this case, while helper function could return MIN/MAX data types.
Is there any possibility to use helper function in all the cases? instead of using embedder UDIV/SDIV.
Thanks in advance,
Dmitry