div: Move __aeabi_idiv to __GNUC__; introduce __mesabi_idiv.
* lib/mes/div.c (__aeabi_idiv): Move for conditional compilation. (__mesabi_idiv): New procedure. * module/mescc/armv4/as.scm (armv4:r0/r1): Use __mesabi_idiv.
This commit is contained in:
parent
931ae9280e
commit
95c71f3178
|
@ -120,15 +120,13 @@ __mesabi_imod (long a, long b)
|
||||||
return result.rem;
|
return result.rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !SYSTEM_LIBC && __arm__
|
int
|
||||||
long
|
__mesabi_idiv (int a, int b)
|
||||||
__aeabi_idiv (long a, long b)
|
|
||||||
{
|
{
|
||||||
ldiv_t result;
|
ldiv_t result;
|
||||||
__mesabi_ldiv(a, b, &result);
|
__mesabi_ldiv(a, b, &result);
|
||||||
return result.quot;
|
return result.quot;
|
||||||
}
|
}
|
||||||
#endif // !SYSTEM_LIBC && __arm__
|
|
||||||
|
|
||||||
#if __GNUC__ && !SYSTEM_LIBC && __arm__
|
#if __GNUC__ && !SYSTEM_LIBC && __arm__
|
||||||
// ...-binutils-2.31.1/bin/ld: hash.o: in function `hash_cstring':
|
// ...-binutils-2.31.1/bin/ld: hash.o: in function `hash_cstring':
|
||||||
|
@ -141,6 +139,14 @@ __aeabi_idiv (long a, long b)
|
||||||
// ntoab.c:(.text+0x54): undefined reference to `__aeabi_uidivmod'
|
// ntoab.c:(.text+0x54): undefined reference to `__aeabi_uidivmod'
|
||||||
// ...-binutils-2.31.1/bin/ld: ntoab.c:(.text+0x62): undefined reference to `__aeabi_uidiv'
|
// ...-binutils-2.31.1/bin/ld: ntoab.c:(.text+0x62): undefined reference to `__aeabi_uidiv'
|
||||||
|
|
||||||
|
long
|
||||||
|
__aeabi_idiv (long a, long b)
|
||||||
|
{
|
||||||
|
ldiv_t result;
|
||||||
|
__mesabi_ldiv(a, b, &result);
|
||||||
|
return result.quot;
|
||||||
|
}
|
||||||
|
|
||||||
/* Result: r0: quotient; r1: remainder */
|
/* Result: r0: quotient; r1: remainder */
|
||||||
long
|
long
|
||||||
__aeabi_idivmod (long a, long b)
|
__aeabi_idivmod (long a, long b)
|
||||||
|
|
|
@ -364,10 +364,10 @@
|
||||||
(let ((r0 (get-r0 info))
|
(let ((r0 (get-r0 info))
|
||||||
(r1 (get-r1 info)))
|
(r1 (get-r1 info)))
|
||||||
(if signed?
|
(if signed?
|
||||||
;; __aeabi_idiv(a, b)
|
;; __mesabi_idiv(a, b)
|
||||||
(cons* `(,(string-append "push___%" r1))
|
(cons* `(,(string-append "push___%" r1))
|
||||||
`(,(string-append "push___%" r0))
|
`(,(string-append "push___%" r0))
|
||||||
(armv4:call-label #f "__aeabi_idiv" 2))
|
(armv4:call-label #f "__mesabi_idiv" 2))
|
||||||
;; __mesabi_uldiv(a, b, remainderp)
|
;; __mesabi_uldiv(a, b, remainderp)
|
||||||
(cons* `(,(string-append "push___0"))
|
(cons* `(,(string-append "push___0"))
|
||||||
`(,(string-append "push___%" r1))
|
`(,(string-append "push___%" r1))
|
||||||
|
|
Loading…
Reference in a new issue