Auto merge of #71 - japaric:aeabi-aliases, r=japaric

add missing aeabi aliases
This commit is contained in:
homunkulus 2016-09-22 22:55:43 +00:00
commit d5e38beef9
2 changed files with 33 additions and 16 deletions

View File

@ -57,10 +57,15 @@ pub unsafe fn __aeabi_ldivmod() {
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)]
pub extern "C" fn __aeabi_uidiv(a: u32, b: u32) -> u32 {
::int::udiv::__udivsi3(a, b)
pub extern "C" fn __aeabi_dadd(a: f64, b: f64) -> f64 {
::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)]
@ -68,6 +73,31 @@ pub extern "C" fn __aeabi_idiv(a: i32, b: i32) -> i32 {
::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" {
fn memcpy(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!(__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)]
mod tests {
use core::{f32, f64};