ARM: Handle sign when dividing integers using gcc.

* lib/mes/div.c (__aeabi_idivmod): Use ldiv.
(__aeabi_idiv): Use ldiv.
This commit is contained in:
Danny Milosavljevic 2019-03-11 17:41:29 +01:00 committed by Jan Nieuwenhuizen
parent 9ac6d37849
commit 899b613dbc
No known key found for this signature in database
GPG Key ID: F3C1A0D9C1D65273
1 changed files with 4 additions and 4 deletions

View File

@ -122,15 +122,15 @@ ldiv_t ldiv(long a, long b)
long
__aeabi_idivmod (long a, long b)
{
long remainder;
__mesabi_uldiv (a, b, &remainder);
return remainder;
ldiv_t result = ldiv(a, b);
return result.rem;
}
long
__aeabi_idiv (long a, long b)
{
return __mesabi_uldiv (a, b, 0);
ldiv_t result = ldiv(a, b);
return result.quot;
}
unsigned long