File tree Expand file tree Collapse file tree 5 files changed +12
-11
lines changed Expand file tree Collapse file tree 5 files changed +12
-11
lines changed Original file line number Diff line number Diff line change @@ -126,7 +126,7 @@ features = ["c"]
126
126
- [x] arm/softfloat-alias.list
127
127
- [x] arm/subdf3vfp.S
128
128
- [x] arm/subsf3vfp.S
129
- - [ ] arm/truncdfsf2vfp.S
129
+ - [x ] arm/truncdfsf2vfp.S
130
130
- [ ] arm/udivmodsi4.S (generic version is done)
131
131
- [ ] arm/udivsi3.S (generic version is done)
132
132
- [ ] arm/umodsi3.S (generic version is done)
Original file line number Diff line number Diff line change @@ -227,7 +227,6 @@ mod c {
227
227
( "__negsf2" , "negsf2.c" ) ,
228
228
( "__powixf2" , "powixf2.c" ) ,
229
229
( "__truncdfhf2" , "truncdfhf2.c" ) ,
230
- ( "__truncdfsf2" , "truncdfsf2.c" ) ,
231
230
( "__truncsfhf2" , "truncsfhf2.c" ) ,
232
231
] ) ;
233
232
}
Original file line number Diff line number Diff line change @@ -24,16 +24,9 @@ extern "C" {}
24
24
// have an additional comment: the function name is the ARM name for the intrinsic and the comment
25
25
// in the non-ARM name for the intrinsic.
26
26
mod intrinsics {
27
- // trunccdfsf2
27
+ // truncdfsf2
28
28
pub fn aeabi_d2f ( x : f64 ) -> f32 {
29
- // This is only implemented in C currently, so only test it there.
30
- #[ cfg( feature = "c" ) ]
31
- return x as f32 ;
32
- #[ cfg( not( feature = "c" ) ) ]
33
- {
34
- drop ( x) ;
35
- 0.0
36
- }
29
+ x as f32
37
30
}
38
31
39
32
// fixdfsi
Original file line number Diff line number Diff line change @@ -112,6 +112,7 @@ where
112
112
}
113
113
114
114
intrinsics ! {
115
+ #[ aapcs_on_arm]
115
116
#[ arm_aeabi_alias = __aeabi_d2f]
116
117
pub extern "C" fn __truncdfsf2( a: f64 ) -> f32 {
117
118
trunc( a)
Original file line number Diff line number Diff line change @@ -204,3 +204,11 @@ fn float_trunc() {
204
204
205
205
trunc ! ( f64 , f32 , __truncdfsf2) ;
206
206
}
207
+
208
+ #[ cfg( target_arch = "arm" ) ]
209
+ #[ test]
210
+ fn float_trunc_arm ( ) {
211
+ use compiler_builtins:: float:: trunc:: __truncdfsf2vfp;
212
+
213
+ trunc ! ( f64 , f32 , __truncdfsf2vfp) ;
214
+ }
You can’t perform that action at this time.
0 commit comments