Merge pull request #34 from Amanieu/thumbv6m_asm
Fix inline assembly to work on ARMv6-M
This commit is contained in:
commit
ac9f96fb9c
17
src/arm.rs
17
src/arm.rs
|
@ -9,7 +9,8 @@ pub unsafe fn __aeabi_uidivmod() {
|
||||||
sub sp, sp, #4
|
sub sp, sp, #4
|
||||||
mov r2, sp
|
mov r2, sp
|
||||||
bl __udivmodsi4
|
bl __udivmodsi4
|
||||||
ldr r1, [sp], #4
|
ldr r1, [sp]
|
||||||
|
add sp, sp, #4
|
||||||
pop {pc}");
|
pop {pc}");
|
||||||
intrinsics::unreachable();
|
intrinsics::unreachable();
|
||||||
}
|
}
|
||||||
|
@ -17,13 +18,15 @@ pub unsafe fn __aeabi_uidivmod() {
|
||||||
#[naked]
|
#[naked]
|
||||||
#[cfg_attr(not(test), no_mangle)]
|
#[cfg_attr(not(test), no_mangle)]
|
||||||
pub unsafe fn __aeabi_uldivmod() {
|
pub unsafe fn __aeabi_uldivmod() {
|
||||||
asm!("push {lr}
|
asm!("push {r4, lr}
|
||||||
sub r12, sp, #12
|
sub sp, sp, #16
|
||||||
str r12, [sp, #-20]!
|
add r4, sp, #8
|
||||||
|
str r4, [sp]
|
||||||
bl __udivmoddi4
|
bl __udivmoddi4
|
||||||
ldrd r2, r3, [sp, #8]
|
ldr r2, [sp, #8]
|
||||||
add sp, sp, #20
|
ldr r3, [sp, #12]
|
||||||
pop {pc}");
|
add sp, sp, #16
|
||||||
|
pop {r4, pc}");
|
||||||
intrinsics::unreachable();
|
intrinsics::unreachable();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue