add missing aeabi aliases

This commit is contained in:
Jorge Aparicio 2016-09-22 12:44:22 -05:00
parent 9d74cf08b8
commit d34be6ab4e
2 changed files with 33 additions and 16 deletions

View File

@ -57,10 +57,15 @@ pub unsafe fn __aeabi_ldivmod() {
intrinsics::unreachable(); intrinsics::unreachable();
} }
// TODO: These two functions should be defined as aliases // TODO: These aeabi_* functions should be defined as aliases
#[cfg_attr(not(test), no_mangle)] #[cfg_attr(not(test), no_mangle)]
pub extern "C" fn __aeabi_uidiv(a: u32, b: u32) -> u32 { pub extern "C" fn __aeabi_dadd(a: f64, b: f64) -> f64 {
::int::udiv::__udivsi3(a, b) ::float::add::__adddf3(a, b)
}
#[cfg_attr(not(test), no_mangle)]
pub extern "C" fn __aeabi_fadd(a: f32, b: f32) -> f32 {
::float::add::__addsf3(a, b)
} }
#[cfg_attr(not(test), no_mangle)] #[cfg_attr(not(test), no_mangle)]
@ -68,6 +73,31 @@ pub extern "C" fn __aeabi_idiv(a: i32, b: i32) -> i32 {
::int::sdiv::__divsi3(a, b) ::int::sdiv::__divsi3(a, b)
} }
#[cfg_attr(not(test), no_mangle)]
pub extern "C" fn __aeabi_lasr(a: i64, b: u32) -> i64 {
::int::shift::__ashrdi3(a, b)
}
#[cfg_attr(not(test), no_mangle)]
pub extern "C" fn __aeabi_llsl(a: u64, b: u32) -> u64 {
::int::shift::__ashldi3(a, b)
}
#[cfg_attr(not(test), no_mangle)]
pub extern "C" fn __aeabi_llsr(a: u64, b: u32) -> u64 {
::int::shift::__lshrdi3(a, b)
}
#[cfg_attr(not(test), no_mangle)]
pub extern "C" fn __aeabi_lmul(a: u64, b: u64) -> u64 {
::int::mul::__muldi3(a, b)
}
#[cfg_attr(not(test), no_mangle)]
pub extern "C" fn __aeabi_uidiv(a: u32, b: u32) -> u32 {
::int::udiv::__udivsi3(a, b)
}
extern "C" { extern "C" {
fn memcpy(dest: *mut u8, src: *const u8, n: usize) -> *mut u8; fn memcpy(dest: *mut u8, src: *const u8, n: usize) -> *mut u8;
fn memmove(dest: *mut u8, src: *const u8, n: usize) -> *mut u8; fn memmove(dest: *mut u8, src: *const u8, n: usize) -> *mut u8;

View File

@ -183,19 +183,6 @@ macro_rules! add {
add!(__addsf3: f32); add!(__addsf3: f32);
add!(__adddf3: f64); add!(__adddf3: f64);
// FIXME: Implement these using aliases
#[cfg(target_arch = "arm")]
#[cfg_attr(not(test), no_mangle)]
pub extern fn __aeabi_dadd(a: f64, b: f64) -> f64 {
__adddf3(a, b)
}
#[cfg(target_arch = "arm")]
#[cfg_attr(not(test), no_mangle)]
pub extern fn __aeabi_fadd(a: f32, b: f32) -> f32 {
__addsf3(a, b)
}
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use core::{f32, f64}; use core::{f32, f64};