|
@@ -9,135 +9,135 @@ use core::intrinsics;
|
|
|
#[cfg(not(any(target_os = "ios", target_env = "msvc")))]
|
|
|
#[naked]
|
|
|
#[cfg_attr(not(feature = "mangled-names"), no_mangle)]
|
|
|
-pub unsafe fn __aeabi_uidivmod() {
|
|
|
- llvm_asm!("
|
|
|
- push {lr}
|
|
|
- sub sp, sp, #4
|
|
|
- mov r2, sp
|
|
|
- bl __udivmodsi4
|
|
|
- ldr r1, [sp]
|
|
|
- add sp, sp, #4
|
|
|
- pop {pc}
|
|
|
- " ::: "memory" : "volatile");
|
|
|
- intrinsics::unreachable();
|
|
|
+pub unsafe extern "C" fn __aeabi_uidivmod() {
|
|
|
+ asm!(
|
|
|
+ "push {{lr}}",
|
|
|
+ "sub sp, sp, #4",
|
|
|
+ "mov r2, sp",
|
|
|
+ "bl __udivmodsi4",
|
|
|
+ "ldr r1, [sp]",
|
|
|
+ "add sp, sp, #4",
|
|
|
+ "pop {{pc}}",
|
|
|
+ options(noreturn)
|
|
|
+ );
|
|
|
}
|
|
|
|
|
|
#[cfg(target_os = "ios")]
|
|
|
#[naked]
|
|
|
#[cfg_attr(not(feature = "mangled-names"), no_mangle)]
|
|
|
-pub unsafe fn __aeabi_uidivmod() {
|
|
|
- llvm_asm!("
|
|
|
- push {lr}
|
|
|
- sub sp, sp, #4
|
|
|
- mov r2, sp
|
|
|
- bl ___udivmodsi4
|
|
|
- ldr r1, [sp]
|
|
|
- add sp, sp, #4
|
|
|
- pop {pc}
|
|
|
- " ::: "memory" : "volatile");
|
|
|
- intrinsics::unreachable();
|
|
|
+pub unsafe extern "C" fn __aeabi_uidivmod() {
|
|
|
+ asm!(
|
|
|
+ "push {{lr}}",
|
|
|
+ "sub sp, sp, #4",
|
|
|
+ "mov r2, sp",
|
|
|
+ "bl ___udivmodsi4",
|
|
|
+ "ldr r1, [sp]",
|
|
|
+ "add sp, sp, #4",
|
|
|
+ "pop {{pc}}",
|
|
|
+ options(noreturn)
|
|
|
+ );
|
|
|
}
|
|
|
|
|
|
#[cfg(not(target_os = "ios"))]
|
|
|
#[naked]
|
|
|
#[cfg_attr(not(feature = "mangled-names"), no_mangle)]
|
|
|
-pub unsafe fn __aeabi_uldivmod() {
|
|
|
- llvm_asm!("
|
|
|
- push {r4, lr}
|
|
|
- sub sp, sp, #16
|
|
|
- add r4, sp, #8
|
|
|
- str r4, [sp]
|
|
|
- bl __udivmoddi4
|
|
|
- ldr r2, [sp, #8]
|
|
|
- ldr r3, [sp, #12]
|
|
|
- add sp, sp, #16
|
|
|
- pop {r4, pc}
|
|
|
- " ::: "memory" : "volatile");
|
|
|
- intrinsics::unreachable();
|
|
|
+pub unsafe extern "C" fn __aeabi_uldivmod() {
|
|
|
+ asm!(
|
|
|
+ "push {{r4, lr}}",
|
|
|
+ "sub sp, sp, #16",
|
|
|
+ "add r4, sp, #8",
|
|
|
+ "str r4, [sp]",
|
|
|
+ "bl __udivmoddi4",
|
|
|
+ "ldr r2, [sp, #8]",
|
|
|
+ "ldr r3, [sp, #12]",
|
|
|
+ "add sp, sp, #16",
|
|
|
+ "pop {{r4, pc}}",
|
|
|
+ options(noreturn)
|
|
|
+ );
|
|
|
}
|
|
|
|
|
|
#[cfg(target_os = "ios")]
|
|
|
#[naked]
|
|
|
#[cfg_attr(not(feature = "mangled-names"), no_mangle)]
|
|
|
-pub unsafe fn __aeabi_uldivmod() {
|
|
|
- llvm_asm!("
|
|
|
- push {r4, lr}
|
|
|
- sub sp, sp, #16
|
|
|
- add r4, sp, #8
|
|
|
- str r4, [sp]
|
|
|
- bl ___udivmoddi4
|
|
|
- ldr r2, [sp, #8]
|
|
|
- ldr r3, [sp, #12]
|
|
|
- add sp, sp, #16
|
|
|
- pop {r4, pc}
|
|
|
- " ::: "memory" : "volatile");
|
|
|
- intrinsics::unreachable();
|
|
|
+pub unsafe extern "C" fn __aeabi_uldivmod() {
|
|
|
+ asm!(
|
|
|
+ "push {{r4, lr}}",
|
|
|
+ "sub sp, sp, #16",
|
|
|
+ "add r4, sp, #8",
|
|
|
+ "str r4, [sp]",
|
|
|
+ "bl ___udivmoddi4",
|
|
|
+ "ldr r2, [sp, #8]",
|
|
|
+ "ldr r3, [sp, #12]",
|
|
|
+ "add sp, sp, #16",
|
|
|
+ "pop {{r4, pc}}",
|
|
|
+ options(noreturn)
|
|
|
+ );
|
|
|
}
|
|
|
|
|
|
#[cfg(not(target_os = "ios"))]
|
|
|
#[naked]
|
|
|
#[cfg_attr(not(feature = "mangled-names"), no_mangle)]
|
|
|
-pub unsafe fn __aeabi_idivmod() {
|
|
|
- llvm_asm!("
|
|
|
- push {r0, r1, r4, lr}
|
|
|
- bl __aeabi_idiv
|
|
|
- pop {r1, r2}
|
|
|
- muls r2, r2, r0
|
|
|
- subs r1, r1, r2
|
|
|
- pop {r4, pc}
|
|
|
- " ::: "memory" : "volatile");
|
|
|
- intrinsics::unreachable();
|
|
|
+pub unsafe extern "C" fn __aeabi_idivmod() {
|
|
|
+ asm!(
|
|
|
+ "push {{r0, r1, r4, lr}}",
|
|
|
+ "bl __aeabi_idiv",
|
|
|
+ "pop {{r1, r2}}",
|
|
|
+ "muls r2, r2, r0",
|
|
|
+ "subs r1, r1, r2",
|
|
|
+ "pop {{r4, pc}}",
|
|
|
+ options(noreturn)
|
|
|
+ );
|
|
|
}
|
|
|
|
|
|
#[cfg(target_os = "ios")]
|
|
|
#[naked]
|
|
|
#[cfg_attr(not(feature = "mangled-names"), no_mangle)]
|
|
|
-pub unsafe fn __aeabi_idivmod() {
|
|
|
- llvm_asm!("
|
|
|
- push {r0, r1, r4, lr}
|
|
|
- bl ___aeabi_idiv
|
|
|
- pop {r1, r2}
|
|
|
- muls r2, r2, r0
|
|
|
- subs r1, r1, r2
|
|
|
- pop {r4, pc}
|
|
|
- " ::: "memory" : "volatile");
|
|
|
- intrinsics::unreachable();
|
|
|
+pub unsafe extern "C" fn __aeabi_idivmod() {
|
|
|
+ asm!(
|
|
|
+ "push {{r0, r1, r4, lr}}",
|
|
|
+ "bl ___aeabi_idiv",
|
|
|
+ "pop {{r1, r2}}",
|
|
|
+ "muls r2, r2, r0",
|
|
|
+ "subs r1, r1, r2",
|
|
|
+ "pop {{r4, pc}}",
|
|
|
+ options(noreturn)
|
|
|
+ );
|
|
|
}
|
|
|
|
|
|
#[cfg(not(target_os = "ios"))]
|
|
|
#[naked]
|
|
|
#[cfg_attr(not(feature = "mangled-names"), no_mangle)]
|
|
|
-pub unsafe fn __aeabi_ldivmod() {
|
|
|
- llvm_asm!("
|
|
|
- push {r4, lr}
|
|
|
- sub sp, sp, #16
|
|
|
- add r4, sp, #8
|
|
|
- str r4, [sp]
|
|
|
- bl __divmoddi4
|
|
|
- ldr r2, [sp, #8]
|
|
|
- ldr r3, [sp, #12]
|
|
|
- add sp, sp, #16
|
|
|
- pop {r4, pc}
|
|
|
- " ::: "memory" : "volatile");
|
|
|
- intrinsics::unreachable();
|
|
|
+pub unsafe extern "C" fn __aeabi_ldivmod() {
|
|
|
+ asm!(
|
|
|
+ "push {{r4, lr}}",
|
|
|
+ "sub sp, sp, #16",
|
|
|
+ "add r4, sp, #8",
|
|
|
+ "str r4, [sp]",
|
|
|
+ "bl __divmoddi4",
|
|
|
+ "ldr r2, [sp, #8]",
|
|
|
+ "ldr r3, [sp, #12]",
|
|
|
+ "add sp, sp, #16",
|
|
|
+ "pop {{r4, pc}}",
|
|
|
+ options(noreturn)
|
|
|
+ );
|
|
|
}
|
|
|
|
|
|
#[cfg(target_os = "ios")]
|
|
|
#[naked]
|
|
|
#[cfg_attr(not(feature = "mangled-names"), no_mangle)]
|
|
|
-pub unsafe fn __aeabi_ldivmod() {
|
|
|
- llvm_asm!("
|
|
|
- push {r4, lr}
|
|
|
- sub sp, sp, #16
|
|
|
- add r4, sp, #8
|
|
|
- str r4, [sp]
|
|
|
- bl ___divmoddi4
|
|
|
- ldr r2, [sp, #8]
|
|
|
- ldr r3, [sp, #12]
|
|
|
- add sp, sp, #16
|
|
|
- pop {r4, pc}
|
|
|
- " ::: "memory" : "volatile");
|
|
|
- intrinsics::unreachable();
|
|
|
+pub unsafe extern "C" fn __aeabi_ldivmod() {
|
|
|
+ asm!(
|
|
|
+ "push {{r4, lr}}",
|
|
|
+ "sub sp, sp, #16",
|
|
|
+ "add r4, sp, #8",
|
|
|
+ "str r4, [sp]",
|
|
|
+ "bl ___divmoddi4",
|
|
|
+ "ldr r2, [sp, #8]",
|
|
|
+ "ldr r3, [sp, #12]",
|
|
|
+ "add sp, sp, #16",
|
|
|
+ "pop {{r4, pc}}",
|
|
|
+ options(noreturn)
|
|
|
+ );
|
|
|
}
|
|
|
|
|
|
// The following functions use weak linkage to allow users to override
|