Remove truncdfsf2.c from sources in build.rs and add test for __truncdfsf2vfp

Also fixed the calling convention for truncdfsf2 on ARM
This commit is contained in:
Ayrton 2021-12-12 21:12:42 -05:00
parent 03b4f62337
commit 9124cdc7ec
5 changed files with 12 additions and 11 deletions

View file

@ -126,7 +126,7 @@ features = ["c"]
- [x] arm/softfloat-alias.list
- [x] arm/subdf3vfp.S
- [x] arm/subsf3vfp.S
- [ ] arm/truncdfsf2vfp.S
- [x] arm/truncdfsf2vfp.S
- [ ] arm/udivmodsi4.S (generic version is done)
- [ ] arm/udivsi3.S (generic version is done)
- [ ] arm/umodsi3.S (generic version is done)

View file

@ -227,7 +227,6 @@ mod c {
("__negsf2", "negsf2.c"),
("__powixf2", "powixf2.c"),
("__truncdfhf2", "truncdfhf2.c"),
("__truncdfsf2", "truncdfsf2.c"),
("__truncsfhf2", "truncsfhf2.c"),
]);
}

View file

@ -24,16 +24,9 @@ extern "C" {}
// have an additional comment: the function name is the ARM name for the intrinsic and the comment
// in the non-ARM name for the intrinsic.
mod intrinsics {
// trunccdfsf2
// truncdfsf2
pub fn aeabi_d2f(x: f64) -> f32 {
// This is only implemented in C currently, so only test it there.
#[cfg(feature = "c")]
return x as f32;
#[cfg(not(feature = "c"))]
{
drop(x);
0.0
}
x as f32
}
// fixdfsi

View file

@ -112,6 +112,7 @@ where
}
intrinsics! {
#[aapcs_on_arm]
#[arm_aeabi_alias = __aeabi_d2f]
pub extern "C" fn __truncdfsf2(a: f64) -> f32 {
trunc(a)

View file

@ -204,3 +204,11 @@ fn float_trunc() {
trunc!(f64, f32, __truncdfsf2);
}
#[cfg(target_arch = "arm")]
#[test]
fn float_trunc_arm() {
use compiler_builtins::float::trunc::__truncdfsf2vfp;
trunc!(f64, f32, __truncdfsf2vfp);
}