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"]
126126- [x] arm/softfloat-alias.list
127127- [x] arm/subdf3vfp.S
128128- [x] arm/subsf3vfp.S
129- - [ ] arm/truncdfsf2vfp.S
129+ - [x ] arm/truncdfsf2vfp.S
130130- [ ] arm/udivmodsi4.S (generic version is done)
131131- [ ] arm/udivsi3.S (generic version is done)
132132- [ ] arm/umodsi3.S (generic version is done)
Original file line number Diff line number Diff line change @@ -227,7 +227,6 @@ mod c {
227227 ( "__negsf2" , "negsf2.c" ) ,
228228 ( "__powixf2" , "powixf2.c" ) ,
229229 ( "__truncdfhf2" , "truncdfhf2.c" ) ,
230- ( "__truncdfsf2" , "truncdfsf2.c" ) ,
231230 ( "__truncsfhf2" , "truncsfhf2.c" ) ,
232231 ] ) ;
233232 }
Original file line number Diff line number Diff line change @@ -24,16 +24,9 @@ extern "C" {}
2424// have an additional comment: the function name is the ARM name for the intrinsic and the comment
2525// in the non-ARM name for the intrinsic.
2626mod intrinsics {
27- // trunccdfsf2
27+ // truncdfsf2
2828 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
3730 }
3831
3932 // fixdfsi
Original file line number Diff line number Diff line change @@ -112,6 +112,7 @@ where
112112}
113113
114114intrinsics ! {
115+ #[ aapcs_on_arm]
115116 #[ arm_aeabi_alias = __aeabi_d2f]
116117 pub extern "C" fn __truncdfsf2( a: f64 ) -> f32 {
117118 trunc( a)
Original file line number Diff line number Diff line change @@ -204,3 +204,11 @@ fn float_trunc() {
204204
205205 trunc ! ( f64 , f32 , __truncdfsf2) ;
206206}
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