From 63e1dd75ff773a5680d80c17989c2748038cba11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20B=C3=A9chet?= Date: Mon, 26 Aug 2024 16:26:46 +0200 Subject: [PATCH] remove all *vfp fn as @Amanieu asks. Remove tests too. --- src/float/add.rs | 10 -------- src/float/cmp.rs | 51 -------------------------------------- src/float/div.rs | 10 -------- src/float/extend.rs | 5 ---- src/float/mul.rs | 10 -------- src/float/sub.rs | 10 -------- src/float/trunc.rs | 5 ---- testcrate/tests/addsub.rs | 12 +-------- testcrate/tests/cmp.rs | 14 ----------- testcrate/tests/conv.rs | 12 --------- testcrate/tests/div_rem.rs | 10 -------- testcrate/tests/mul.rs | 12 +-------- 12 files changed, 2 insertions(+), 159 deletions(-) diff --git a/src/float/add.rs b/src/float/add.rs index 03ed131a..bceef7b0 100644 --- a/src/float/add.rs +++ b/src/float/add.rs @@ -208,14 +208,4 @@ intrinsics! { pub extern "C" fn __addtf3(a: f128, b: f128) -> f128 { add(a, b) } - - #[cfg(target_arch = "arm")] - pub extern "C" fn __addsf3vfp(a: f32, b: f32) -> f32 { - a + b - } - - #[cfg(target_arch = "arm")] - pub extern "C" fn __adddf3vfp(a: f64, b: f64) -> f64 { - a + b - } } diff --git a/src/float/cmp.rs b/src/float/cmp.rs index 1901ca4b..bb7d4b49 100644 --- a/src/float/cmp.rs +++ b/src/float/cmp.rs @@ -258,55 +258,4 @@ intrinsics! { pub extern "aapcs" fn __aeabi_dcmpgt(a: f64, b: f64) -> i32 { (__gtdf2(a, b) > 0) as i32 } - - // On hard-float targets LLVM will use native instructions - // for all VFP intrinsics below - - pub extern "C" fn __gesf2vfp(a: f32, b: f32) -> i32 { - (a >= b) as i32 - } - - pub extern "C" fn __gedf2vfp(a: f64, b: f64) -> i32 { - (a >= b) as i32 - } - - pub extern "C" fn __gtsf2vfp(a: f32, b: f32) -> i32 { - (a > b) as i32 - } - - pub extern "C" fn __gtdf2vfp(a: f64, b: f64) -> i32 { - (a > b) as i32 - } - - pub extern "C" fn __ltsf2vfp(a: f32, b: f32) -> i32 { - (a < b) as i32 - } - - pub extern "C" fn __ltdf2vfp(a: f64, b: f64) -> i32 { - (a < b) as i32 - } - - pub extern "C" fn __lesf2vfp(a: f32, b: f32) -> i32 { - (a <= b) as i32 - } - - pub extern "C" fn __ledf2vfp(a: f64, b: f64) -> i32 { - (a <= b) as i32 - } - - pub extern "C" fn __nesf2vfp(a: f32, b: f32) -> i32 { - (a != b) as i32 - } - - pub extern "C" fn __nedf2vfp(a: f64, b: f64) -> i32 { - (a != b) as i32 - } - - pub extern "C" fn __eqsf2vfp(a: f32, b: f32) -> i32 { - (a == b) as i32 - } - - pub extern "C" fn __eqdf2vfp(a: f64, b: f64) -> i32 { - (a == b) as i32 - } } diff --git a/src/float/div.rs b/src/float/div.rs index c0d780b6..2a57ee1a 100644 --- a/src/float/div.rs +++ b/src/float/div.rs @@ -926,14 +926,4 @@ intrinsics! { pub extern "C" fn __divdf3(a: f64, b: f64) -> f64 { div64(a, b) } - - #[cfg(target_arch = "arm")] - pub extern "C" fn __divsf3vfp(a: f32, b: f32) -> f32 { - a / b - } - - #[cfg(target_arch = "arm")] - pub extern "C" fn __divdf3vfp(a: f64, b: f64) -> f64 { - a / b - } } diff --git a/src/float/extend.rs b/src/float/extend.rs index 9fabcde2..997475c8 100644 --- a/src/float/extend.rs +++ b/src/float/extend.rs @@ -76,11 +76,6 @@ intrinsics! { pub extern "C" fn __extendsfdf2(a: f32) -> f64 { extend(a) } - - #[cfg(target_arch = "arm")] - pub extern "C" fn __extendsfdf2vfp(a: f32) -> f64 { - a as f64 // LLVM generate 'fcvtds' - } } intrinsics! { diff --git a/src/float/mul.rs b/src/float/mul.rs index cb0fcdfa..a4c69ea8 100644 --- a/src/float/mul.rs +++ b/src/float/mul.rs @@ -199,14 +199,4 @@ intrinsics! { pub extern "C" fn __multf3(a: f128, b: f128) -> f128 { mul(a, b) } - - #[cfg(target_arch = "arm")] - pub extern "C" fn __mulsf3vfp(a: f32, b: f32) -> f32 { - a * b - } - - #[cfg(target_arch = "arm")] - pub extern "C" fn __muldf3vfp(a: f64, b: f64) -> f64 { - a * b - } } diff --git a/src/float/sub.rs b/src/float/sub.rs index d33016ea..7e8a8945 100644 --- a/src/float/sub.rs +++ b/src/float/sub.rs @@ -23,14 +23,4 @@ intrinsics! { __addtf3(a, f128::from_repr(b.repr() ^ f128::SIGN_MASK)) } - - #[cfg(target_arch = "arm")] - pub extern "C" fn __subsf3vfp(a: f32, b: f32) -> f32 { - a - b - } - - #[cfg(target_arch = "arm")] - pub extern "C" fn __subdf3vfp(a: f64, b: f64) -> f64 { - a - b - } } diff --git a/src/float/trunc.rs b/src/float/trunc.rs index 5c17cd96..a25b6eab 100644 --- a/src/float/trunc.rs +++ b/src/float/trunc.rs @@ -124,11 +124,6 @@ intrinsics! { pub extern "C" fn __truncdfsf2(a: f64) -> f32 { trunc(a) } - - #[cfg(target_arch = "arm")] - pub extern "C" fn __truncdfsf2vfp(a: f64) -> f32 { - a as f32 - } } intrinsics! { diff --git a/testcrate/tests/addsub.rs b/testcrate/tests/addsub.rs index 1ba2df74..bf05c4dd 100644 --- a/testcrate/tests/addsub.rs +++ b/testcrate/tests/addsub.rs @@ -138,14 +138,4 @@ mod float_addsub_f128_ppc { float_sum! { f128, __addkf3, __subkf3, Quad, not(feature = "no-sys-f128"); } -} - -#[cfg(target_arch = "arm")] -mod float_addsub_arm { - use super::*; - - float_sum! { - f32, __addsf3vfp, __subsf3vfp, Single, all(); - f64, __adddf3vfp, __subdf3vfp, Double, all(); - } -} +} \ No newline at end of file diff --git a/testcrate/tests/cmp.rs b/testcrate/tests/cmp.rs index 7e973e7e..e3161f37 100644 --- a/testcrate/tests/cmp.rs +++ b/testcrate/tests/cmp.rs @@ -156,7 +156,6 @@ mod float_comparisons_arm { fn cmp_f32() { use compiler_builtins::float::cmp::{ __aeabi_fcmpeq, __aeabi_fcmpge, __aeabi_fcmpgt, __aeabi_fcmple, __aeabi_fcmplt, - __eqsf2vfp, __gesf2vfp, __gtsf2vfp, __lesf2vfp, __ltsf2vfp, __nesf2vfp, }; fuzz_float_2(N, |x: f32, y: f32| { @@ -166,12 +165,6 @@ mod float_comparisons_arm { 0, x == y, __aeabi_fcmpeq; 0, x >= y, __aeabi_fcmpge; 0, x > y, __aeabi_fcmpgt; - 0, x < y, __ltsf2vfp; - 0, x <= y, __lesf2vfp; - 0, x == y, __eqsf2vfp; - 0, x >= y, __gesf2vfp; - 0, x > y, __gtsf2vfp; - 1, x != y, __nesf2vfp; ); }); } @@ -180,7 +173,6 @@ mod float_comparisons_arm { fn cmp_f64() { use compiler_builtins::float::cmp::{ __aeabi_dcmpeq, __aeabi_dcmpge, __aeabi_dcmpgt, __aeabi_dcmple, __aeabi_dcmplt, - __eqdf2vfp, __gedf2vfp, __gtdf2vfp, __ledf2vfp, __ltdf2vfp, __nedf2vfp, }; fuzz_float_2(N, |x: f64, y: f64| { @@ -190,12 +182,6 @@ mod float_comparisons_arm { 0, x == y, __aeabi_dcmpeq; 0, x >= y, __aeabi_dcmpge; 0, x > y, __aeabi_dcmpgt; - 0, x < y, __ltdf2vfp; - 0, x <= y, __ledf2vfp; - 0, x == y, __eqdf2vfp; - 0, x >= y, __gedf2vfp; - 0, x > y, __gtdf2vfp; - 1, x != y, __nedf2vfp; ); }); } diff --git a/testcrate/tests/conv.rs b/testcrate/tests/conv.rs index ce1f64e6..24f3a04a 100644 --- a/testcrate/tests/conv.rs +++ b/testcrate/tests/conv.rs @@ -258,12 +258,6 @@ mod extend { f32 => f64, Single => Double, __extendsfdf2, all(); } - #[cfg(target_arch = "arm")] - f_to_f! { - extend, - f32 => f64, Single => Double, __extendsfdf2vfp, all(); - } - #[cfg(all(f16_enabled, f128_enabled))] #[cfg(not(any(target_arch = "powerpc", target_arch = "powerpc64")))] f_to_f! { @@ -293,12 +287,6 @@ mod trunc { f64 => f32, Double => Single, __truncdfsf2, all(); } - #[cfg(target_arch = "arm")] - f_to_f! { - trunc, - f64 => f32, Double => Single, __truncdfsf2vfp, all(); - } - #[cfg(all(f16_enabled, f128_enabled))] #[cfg(not(any(target_arch = "powerpc", target_arch = "powerpc64")))] f_to_f! { diff --git a/testcrate/tests/div_rem.rs b/testcrate/tests/div_rem.rs index ff78b4f5..418e9c18 100644 --- a/testcrate/tests/div_rem.rs +++ b/testcrate/tests/div_rem.rs @@ -156,13 +156,3 @@ mod float_div { f64, __divdf3, Double, all(); } } - -#[cfg(target_arch = "arm")] -mod float_div_arm { - use super::*; - - float! { - f32, __divsf3vfp, Single, all(); - f64, __divdf3vfp, Double, all(); - } -} diff --git a/testcrate/tests/mul.rs b/testcrate/tests/mul.rs index 867622fd..6f729521 100644 --- a/testcrate/tests/mul.rs +++ b/testcrate/tests/mul.rs @@ -152,14 +152,4 @@ mod float_mul_f128_ppc { float_mul! { f128, __mulkf3, Quad, not(feature = "no-sys-f128"); } -} - -#[cfg(target_arch = "arm")] -mod float_mul_arm { - use super::*; - - float_mul! { - f32, __mulsf3vfp, Single, all(); - f64, __muldf3vfp, Double, all(); - } -} +} \ No newline at end of file