1 /* SPDX-License-Identifier: ISC OR GPL-2.0-only */
4 * ldivmod.S: signed 64 bit division (quotient and remainder)
6 * Taken from CrOS EC: third_party/libaeabi-cortexm0/core/cortex-m0/ldivmod.S
12 @ {long long quotient, long long remainder}
13 @ __aeabi_ldivmod(long long numerator, long long denominator)
15 @ Divide r1:r0 by r3:r2 and return the quotient in r1:r0 and the remainder in
19 ENTRY(__aeabi_ldivmod)
25 movs r4, #0 @ num = -num
33 movs r4, #0 @ den = -den
38 movs r4, #0 @ rem = -rem
46 movs r4, #0 @ quot = -quot
50 movs r4, #0 @ rem = -rem
60 bl __aeabi_uldivmod @ offset too big for b / bge
65 movs r4, #0 @ den = -den
70 movs r4, #0 @ quot = -quot