comparesf2/comparedf2: use i32 instead of bool for return type.

Note that this changes semantics:
    pub extern "C" fn __eqsf2(a: f32, b: f32) -> bool {
        cmp(a, b).to_le_abi() != 0
    }

is not the same as

    pub extern "C" fn __eqsf2(a: f32, b: f32) -> i32 {
        cmp(a, b).to_le_abi()
    }

However, compiler-rt does the latter, so this is actually
an improvement.
This commit is contained in:
whitequark 2017-12-29 06:14:51 +00:00
parent f5d86476a8
commit 6adcc9e9cb
1 changed files with 20 additions and 20 deletions

View File

@ -115,24 +115,24 @@ intrinsics! {
} }
#[arm_aeabi_alias = fcmpun] #[arm_aeabi_alias = fcmpun]
pub extern "C" fn __unordsf2(a: f32, b: f32) -> bool { pub extern "C" fn __unordsf2(a: f32, b: f32) -> i32 {
unord(a, b) unord(a, b) as i32
} }
pub extern "C" fn __eqsf2(a: f32, b: f32) -> bool { pub extern "C" fn __eqsf2(a: f32, b: f32) -> i32 {
cmp(a, b).to_le_abi() != 0 cmp(a, b).to_le_abi()
} }
pub extern "C" fn __ltsf2(a: f32, b: f32) -> bool { pub extern "C" fn __ltsf2(a: f32, b: f32) -> i32 {
cmp(a, b).to_le_abi() != 0 cmp(a, b).to_le_abi()
} }
pub extern "C" fn __nesf2(a: f32, b: f32) -> bool { pub extern "C" fn __nesf2(a: f32, b: f32) -> i32 {
cmp(a, b).to_le_abi() != 0 cmp(a, b).to_le_abi()
} }
pub extern "C" fn __gtsf2(a: f32, b: f32) -> bool { pub extern "C" fn __gtsf2(a: f32, b: f32) -> i32 {
cmp(a, b).to_ge_abi() != 0 cmp(a, b).to_ge_abi()
} }
pub extern "C" fn __ledf2(a: f64, b: f64) -> i32 { pub extern "C" fn __ledf2(a: f64, b: f64) -> i32 {
@ -144,23 +144,23 @@ intrinsics! {
} }
#[arm_aeabi_alias = dcmpun] #[arm_aeabi_alias = dcmpun]
pub extern "C" fn __unorddf2(a: f64, b: f64) -> bool { pub extern "C" fn __unorddf2(a: f64, b: f64) -> i32 {
unord(a, b) unord(a, b) as i32
} }
pub extern "C" fn __eqdf2(a: f64, b: f64) -> bool { pub extern "C" fn __eqdf2(a: f64, b: f64) -> i32 {
cmp(a, b).to_le_abi() != 0 cmp(a, b).to_le_abi()
} }
pub extern "C" fn __ltdf2(a: f64, b: f64) -> bool { pub extern "C" fn __ltdf2(a: f64, b: f64) -> i32 {
cmp(a, b).to_le_abi() != 0 cmp(a, b).to_le_abi()
} }
pub extern "C" fn __nedf2(a: f64, b: f64) -> bool { pub extern "C" fn __nedf2(a: f64, b: f64) -> i32 {
cmp(a, b).to_le_abi() != 0 cmp(a, b).to_le_abi()
} }
pub extern "C" fn __gtdf2(a: f32, b: f32) -> bool { pub extern "C" fn __gtdf2(a: f32, b: f32) -> i32 {
cmp(a, b).to_ge_abi() != 0 cmp(a, b).to_ge_abi()
} }
} }