Fix __subsf3 and __subdf3 on x86
Be sure to do not mix hard-float and soft-float calls. Disassembled code show exactly this. So replace add with an explicit call to __addsf3/__adddf3 This seems the root cause of some sporadic failures.
This commit is contained in:
parent
306764b091
commit
2cb290afa3
@ -1,14 +1,16 @@
|
||||
use float::Float;
|
||||
use float::add::__addsf3;
|
||||
use float::add::__adddf3;
|
||||
|
||||
intrinsics! {
|
||||
#[arm_aeabi_alias = __aeabi_fsub]
|
||||
pub extern "C" fn __subsf3(a: f32, b: f32) -> f32 {
|
||||
a + f32::from_repr(b.repr() ^ f32::SIGN_MASK)
|
||||
__addsf3(a, f32::from_repr(b.repr() ^ f32::SIGN_MASK))
|
||||
}
|
||||
|
||||
#[arm_aeabi_alias = __aeabi_dsub]
|
||||
pub extern "C" fn __subdf3(a: f64, b: f64) -> f64 {
|
||||
a + f64::from_repr(b.repr() ^ f64::SIGN_MASK)
|
||||
__adddf3(a, f64::from_repr(b.repr() ^ f64::SIGN_MASK))
|
||||
}
|
||||
|
||||
#[cfg(target_arch = "arm")]
|
||||
|
Loading…
Reference in New Issue
Block a user