[cfe-dev] [LLVMdev] ARM EABI and modulo

Renato Golin renato.golin at linaro.org
Mon Dec 9 06:32:49 PST 2013

On 9 December 2013 14:11, Joerg Sonnenberger <joerg at britannica.bec.de> wrote:
> I was discussing this with Tim on IRC and he raised the valid question
> of a pure mod operation being faster when emulated as it doesn't have to
> keep track of the quotient. So it really boils down to whether it has a
> fancy enough dress to be called a feature.

This is not just about being faster, but also compliant. If you have
to follow the EABI, then you cannot guarantee that you'll have the
__umodsi3 anywhere in any library. If you follow the GNU EABI, than
you have no guarantee that __aeabi_uidivmod will.

Regardless of the performance discussion, I opened this bug:


because of its inconsistency. If you want to call __umodsi3 instead of
__uidivmod, than you should use GNUEABI.

When you need both, calling the EABI variant is faster (only one
function call), but I don't think we should mix the two variants in
EABI mode. If the GNUEABI wants to do that, I don't think it's wrong,
but lets not do this on EABI mode.


More information about the cfe-dev mailing list