From afac5847e784d09a21669910b7f9491325a4b818 Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Thu, 27 Aug 2020 10:06:48 +0200 Subject: [PATCH] div: Remove libgcc-compatible API. * lib/mes/div.c (__aeabi_idiv): Delete procedure. (__aeabi_idivmod): Delete procedure. (__aeabi_uidivmod): Delete procedure. (__aeabi_uidiv): Delete procedure. --- lib/mes/div.c | 51 --------------------------------------------------- 1 file changed, 51 deletions(-) diff --git a/lib/mes/div.c b/lib/mes/div.c index 0b2fd8b1..ce135a29 100644 --- a/lib/mes/div.c +++ b/lib/mes/div.c @@ -127,54 +127,3 @@ __mesabi_idiv (int a, int b) __mesabi_ldiv(a, b, &result); return result.quot; } - -#if __GNUC__ && !SYSTEM_LIBC && __arm__ -// ...-binutils-2.31.1/bin/ld: hash.o: in function `hash_cstring': -// hash.c:(.text+0x56): undefined reference to `__aeabi_idivmod' -// ...-binutils-2.31.1/bin/ld: math.o: in function `divide': -// math.c:(.text+0x516): undefined reference to `__aeabi_idiv' -// ...-binutils-2.31.1/bin/ld: math.o: in function `modulo': -// math.c:(.text+0x5d2): undefined reference to `__aeabi_idivmod' -// ...-binutils-2.31.1/bin/ld: gcc-lib/libc.a(ntoab.o): in function `ntoab': -// ntoab.c:(.text+0x54): undefined reference to `__aeabi_uidivmod' -// ...-binutils-2.31.1/bin/ld: ntoab.c:(.text+0x62): undefined reference to `__aeabi_uidiv' - -/* FIXME: This ABI should use registers for the input arguments, too. -Maybe the others below, too. */ -long -__aeabi_idiv (long a, long b) -{ - ldiv_t result; - __mesabi_ldiv(a, b, &result); - return result.quot; -} - -/* Result: r0: quotient; r1: remainder */ -long -__aeabi_idivmod (long a, long b) -{ - ldiv_t result; - __mesabi_ldiv(a, b, &result); - register long rem_result asm("r1"); - rem_result = result.rem; - return result.quot; -} - -/* Result: r0: quotient; r1: remainder */ -unsigned long -__aeabi_uidivmod (unsigned long a, unsigned long b) -{ - unsigned long quot; - unsigned long rem; - register unsigned long rem_result asm("r1"); - quot = __mesabi_uldiv (a, b, &rem); - rem_result = rem; - return quot; -} - -unsigned long -__aeabi_uidiv (unsigned long a, unsigned long b) -{ - return __mesabi_uldiv (a, b, 0); -} -#endif // __GNUC__ && !SYSTEM_LIBC && __arm__