|
@@ -155,112 +155,3 @@ fp_fix!(__fixunssfsi: f32, u32);
|
|
|
fp_fix!(__fixunssfdi: f32, u64);
|
|
|
fp_fix!(__fixunsdfsi: f64, u32);
|
|
|
fp_fix!(__fixunsdfdi: f64, u64);
|
|
|
-
|
|
|
-// NOTE(cfg) for some reason, on arm*-unknown-linux-gnueabihf, our implementation doesn't
|
|
|
-// match the output of its gcc_s or compiler-rt counterpart. Until we investigate further, we'll
|
|
|
-// just avoid testing against them on those targets. Do note that our implementation gives the
|
|
|
-// correct answer; gcc_s and compiler-rt are incorrect in this case.
|
|
|
-//
|
|
|
-#[cfg(all(test, not(arm_linux)))]
|
|
|
-mod tests {
|
|
|
- use qc::{I32, U32, I64, U64, F32, F64};
|
|
|
-
|
|
|
- check! {
|
|
|
- fn __floatsisf(f: extern "C" fn(i32) -> f32,
|
|
|
- a: I32)
|
|
|
- -> Option<F32> {
|
|
|
- Some(F32(f(a.0)))
|
|
|
- }
|
|
|
- fn __floatsidf(f: extern "C" fn(i32) -> f64,
|
|
|
- a: I32)
|
|
|
- -> Option<F64> {
|
|
|
- Some(F64(f(a.0)))
|
|
|
- }
|
|
|
- fn __floatdidf(f: extern "C" fn(i64) -> f64,
|
|
|
- a: I64)
|
|
|
- -> Option<F64> {
|
|
|
- Some(F64(f(a.0)))
|
|
|
- }
|
|
|
- fn __floatunsisf(f: extern "C" fn(u32) -> f32,
|
|
|
- a: U32)
|
|
|
- -> Option<F32> {
|
|
|
- Some(F32(f(a.0)))
|
|
|
- }
|
|
|
- fn __floatunsidf(f: extern "C" fn(u32) -> f64,
|
|
|
- a: U32)
|
|
|
- -> Option<F64> {
|
|
|
- Some(F64(f(a.0)))
|
|
|
- }
|
|
|
- fn __floatundidf(f: extern "C" fn(u64) -> f64,
|
|
|
- a: U64)
|
|
|
- -> Option<F64> {
|
|
|
- Some(F64(f(a.0)))
|
|
|
- }
|
|
|
-
|
|
|
- fn __fixsfsi(f: extern "C" fn(f32) -> i32,
|
|
|
- a: F32)
|
|
|
- -> Option<I32> {
|
|
|
- if (a.0 as f64) > (i32::max_value() as f64) ||
|
|
|
- (a.0 as f64) < (i32::min_value() as f64) || a.0.is_nan() {
|
|
|
- None
|
|
|
- } else { Some(I32(f(a.0))) }
|
|
|
- }
|
|
|
- fn __fixsfdi(f: extern "C" fn(f32) -> i64,
|
|
|
- a: F32)
|
|
|
- -> Option<I64> {
|
|
|
- if (a.0 as f64) > (i64::max_value() as f64) ||
|
|
|
- (a.0 as f64) < (i64::min_value() as f64) || a.0.is_nan() {
|
|
|
- None
|
|
|
- } else { Some(I64(f(a.0))) }
|
|
|
- }
|
|
|
- fn __fixdfsi(f: extern "C" fn(f64) -> i32,
|
|
|
- a: F64)
|
|
|
- -> Option<I32> {
|
|
|
- if a.0 > (i32::max_value() as f64) ||
|
|
|
- a.0 < (i32::min_value() as f64) || a.0.is_nan() {
|
|
|
- None
|
|
|
- } else { Some(I32(f(a.0))) }
|
|
|
- }
|
|
|
- fn __fixdfdi(f: extern "C" fn(f64) -> i64,
|
|
|
- a: F64)
|
|
|
- -> Option<I64> {
|
|
|
- if a.0 > (i64::max_value() as f64) ||
|
|
|
- a.0 < (i64::min_value() as f64) || a.0.is_nan() {
|
|
|
- None
|
|
|
- } else { Some(I64(f(a.0))) }
|
|
|
- }
|
|
|
-
|
|
|
- fn __fixunssfsi(f: extern "C" fn(f32) -> u32,
|
|
|
- a: F32)
|
|
|
- -> Option<U32> {
|
|
|
- if (a.0 as f64) > (u32::max_value() as f64) ||
|
|
|
- (a.0 as f64) < (u32::min_value() as f64) || a.0.is_nan() {
|
|
|
- None
|
|
|
- } else { Some(U32(f(a.0))) }
|
|
|
- }
|
|
|
- fn __fixunssfdi(f: extern "C" fn(f32) -> u64,
|
|
|
- a: F32)
|
|
|
- -> Option<U64> {
|
|
|
- if (a.0 as f64) > (u64::max_value() as f64) ||
|
|
|
- (a.0 as f64) < (u64::min_value() as f64) || a.0.is_nan() {
|
|
|
- None
|
|
|
- } else { Some(U64(f(a.0))) }
|
|
|
- }
|
|
|
- fn __fixunsdfsi(f: extern "C" fn(f64) -> u32,
|
|
|
- a: F64)
|
|
|
- -> Option<U32> {
|
|
|
- if a.0 > (u32::max_value() as f64) ||
|
|
|
- a.0 < (u32::min_value() as f64) || a.0.is_nan() {
|
|
|
- None
|
|
|
- } else { Some(U32(f(a.0))) }
|
|
|
- }
|
|
|
- fn __fixunsdfdi(f: extern "C" fn(f64) -> u64,
|
|
|
- a: F64)
|
|
|
- -> Option<U64> {
|
|
|
- if a.0 <= (u64::max_value() as f64) ||
|
|
|
- a.0 >= (u64::min_value() as f64) || a.0.is_nan() {
|
|
|
- None
|
|
|
- } else { Some(U64(f(a.0))) }
|
|
|
- }
|
|
|
- }
|
|
|
-}
|