forked from len0rd/rockbox
Correct ARMv5/6 signed divider, which was not saving return address to stack before using lr for calculation.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24457 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
ff6053e4c3
commit
e77cdd147c
1 changed files with 6 additions and 8 deletions
|
@ -582,7 +582,9 @@
|
|||
.ifnc "", "\quotient"
|
||||
mov \quotient, #0
|
||||
.endif
|
||||
.ifnc "", "\remainder"
|
||||
ARM_SDIV32_POST "", \remainder, \sign
|
||||
.endif
|
||||
.ifnc "", "\return"
|
||||
\return
|
||||
.endif
|
||||
|
@ -605,10 +607,10 @@ __div0_wrap:
|
|||
.size __div0_wrap, . - __div0_wrap
|
||||
|
||||
#ifndef __ARM_EABI__
|
||||
#if ARM_ARCH < 5 /* Gigabeat S is crashing on boot with this enabled */
|
||||
.global __divsi3
|
||||
.type __divsi3,%function
|
||||
#endif
|
||||
.global __udivsi3
|
||||
.type __udivsi3,%function
|
||||
.global __udivsi3
|
||||
.type __udivsi3,%function
|
||||
#else
|
||||
|
@ -619,14 +621,12 @@ __div0_wrap:
|
|||
.global __aeabi_uidiv
|
||||
.type __aeabi_uidiv,%function
|
||||
.set __aeabi_uidiv,__aeabi_uidivmod
|
||||
#if ARM_ARCH < 5 /* Gigabeat S is crashing on boot with this enabled */
|
||||
.global __aeabi_idivmod
|
||||
.type __aeabi_idivmod,%function
|
||||
.global __aeabi_idiv
|
||||
.type __aeabi_idiv,%function
|
||||
.set __aeabi_idiv,__aeabi_idivmod
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
#if ARM_ARCH < 5
|
||||
|
@ -675,23 +675,21 @@ __udivsi3:
|
|||
ARMV5_UDIV32_BODY r0, r1, r0, "", r2, r3, ip, __div0_wrap, 1
|
||||
.size __udivsi3, . - __udivsi3
|
||||
|
||||
#if ARM_ARCH < 5 /* Gigabeat S is crashing on boot with this enabled */
|
||||
__divsi3:
|
||||
str lr, [sp, #-4]
|
||||
ARMV5_SDIV32_BODY r0, r1, r0, "", r2, lr, ip, r3, __div0_wrap_s, "ldr pc, [sp, #-4]"
|
||||
.size __divsi3, . - __divsi3
|
||||
#endif
|
||||
|
||||
#else
|
||||
__aeabi_uidivmod:
|
||||
ARMV5_UDIV32_BODY r0, r1, r0, r1, r2, r3, ip, __div0_wrap, 1
|
||||
.size __aeabi_uidivmod, . - __aeabi_uidivmo
|
||||
|
||||
#if ARM_ARCH < 5 /* Gigabeat S is crashing on boot with this enabled */
|
||||
__aeabi_idivmod:
|
||||
str lr, [sp, #-4]
|
||||
ARMV5_SDIV32_BODY r0, r1, r0, r1, r2, lr, ip, r3, __div0_wrap_s, "ldr pc, [sp, #-4]"
|
||||
.size __aeabi_idivmod, . - __aeabi_idivmod
|
||||
#endif
|
||||
#endif
|
||||
|
||||
.L_udiv_est_table:
|
||||
.byte 0xff, 0xfc, 0xf8, 0xf4, 0xf0, 0xed, 0xea, 0xe6
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue