Also fixed the calling convention for truncdfsf2 on ARM
@@ -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)
@@ -227,7 +227,6 @@ mod c {
("__negsf2", "negsf2.c"),
("__powixf2", "powixf2.c"),
("__truncdfhf2", "truncdfhf2.c"),
- ("__truncdfsf2", "truncdfsf2.c"),
("__truncsfhf2", "truncsfhf2.c"),
]);
}
@@ -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
@@ -112,6 +112,7 @@ where
intrinsics! {
+ #[aapcs_on_arm]
#[arm_aeabi_alias = __aeabi_d2f]
pub extern "C" fn __truncdfsf2(a: f64) -> f32 {
trunc(a)
@@ -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);
+}