diff options
Diffstat (limited to 'lib/arm/umodsi3.S')
-rw-r--r-- | lib/arm/umodsi3.S | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/arm/umodsi3.S b/lib/arm/umodsi3.S index 3a2ab2b87751..328e7054b857 100644 --- a/lib/arm/umodsi3.S +++ b/lib/arm/umodsi3.S @@ -23,6 +23,16 @@ .syntax unified .align 3 DEFINE_COMPILERRT_FUNCTION(__umodsi3) +#if __ARM_ARCH_7S__ + tst r1, r1 + beq LOCAL_LABEL(divzero) + udiv r2, r0, r1 + mls r0, r2, r1, r0 + bx lr +LOCAL_LABEL(divzero): + mov r0, #0 + bx lr +#else // We use a simple digit by digit algorithm; before we get into the actual // divide loop, we must calculate the left-shift amount necessary to align // the MSB of the divisor with that of the dividend. @@ -56,3 +66,4 @@ LOCAL_LABEL(mainLoop): subs r, a, b movhs a, r bx lr +#endif |