diff options
Diffstat (limited to 'lib/arm/udivmodsi4.S')
-rw-r--r-- | lib/arm/udivmodsi4.S | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/arm/udivmodsi4.S b/lib/arm/udivmodsi4.S index d164a751..9956cd48 100644 --- a/lib/arm/udivmodsi4.S +++ b/lib/arm/udivmodsi4.S @@ -31,6 +31,18 @@ .syntax unified .align 3 DEFINE_COMPILERRT_FUNCTION(__udivmodsi4) +#if __ARM_ARCH_7S__ + tst r1, r1 + beq LOCAL_LABEL(divzero) + mov r3, r0 + udiv r0, r3, r1 + mls r1, r0, r1, r3 + str r1, [r2] + 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 (If this shift is @@ -78,3 +90,4 @@ LOCAL_LABEL(return): str a, [r2] mov r0, q CLEAR_FRAME_AND_RETURN +#endif |