Skip to content

Commit

Permalink
remove all *vfp fn as @Amanieu asks. Remove tests too.
Browse files Browse the repository at this point in the history
  • Loading branch information
sbechet committed Aug 26, 2024
1 parent 61c5764 commit 63e1dd7
Show file tree
Hide file tree
Showing 12 changed files with 2 additions and 159 deletions.
10 changes: 0 additions & 10 deletions src/float/add.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
51 changes: 0 additions & 51 deletions src/float/cmp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
10 changes: 0 additions & 10 deletions src/float/div.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
5 changes: 0 additions & 5 deletions src/float/extend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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! {
Expand Down
10 changes: 0 additions & 10 deletions src/float/mul.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
10 changes: 0 additions & 10 deletions src/float/sub.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
5 changes: 0 additions & 5 deletions src/float/trunc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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! {
Expand Down
12 changes: 1 addition & 11 deletions testcrate/tests/addsub.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
}
14 changes: 0 additions & 14 deletions testcrate/tests/cmp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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| {
Expand All @@ -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;
);
});
}
Expand All @@ -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| {
Expand All @@ -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;
);
});
}
Expand Down
12 changes: 0 additions & 12 deletions testcrate/tests/conv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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! {
Expand Down Expand Up @@ -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! {
Expand Down
10 changes: 0 additions & 10 deletions testcrate/tests/div_rem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
12 changes: 1 addition & 11 deletions testcrate/tests/mul.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
}

0 comments on commit 63e1dd7

Please sign in to comment.