@@ -75,7 +75,8 @@ macro_rules! try_fixed {
75
75
} )
76
76
}
77
77
78
- #[ cfg( any( target_arch = "x86" , all( target_arch = "aarch64" , target_feature = "neon" ) ) ) ]
78
+ #[ cfg( not( bootstrap) ) ]
79
+ #[ cfg( target_has_reliable_f16) ]
79
80
fn ldexp_f16 ( a : f16 , b : i32 ) -> f16 {
80
81
ldexp_f64 ( a as f64 , b) as f16
81
82
}
@@ -181,7 +182,8 @@ trait TestableFloat: DecodableFloat + fmt::Display {
181
182
fn ldexpi ( f : i64 , exp : isize ) -> Self ;
182
183
}
183
184
184
- #[ cfg( any( target_arch = "x86" , all( target_arch = "aarch64" , target_feature = "neon" ) ) ) ]
185
+ #[ cfg( not( bootstrap) ) ]
186
+ #[ cfg( target_has_reliable_f16) ]
185
187
impl TestableFloat for f16 {
186
188
fn ldexpi ( f : i64 , exp : isize ) -> Self {
187
189
f as Self * ( exp as Self ) . exp2 ( )
@@ -239,7 +241,8 @@ macro_rules! check_exact_one {
239
241
// ftp://ftp.ee.lbl.gov/testbase-report.ps.Z
240
242
// or https://www.icir.org/vern/papers/testbase-report.pdf
241
243
242
- #[ cfg( any( target_arch = "x86" , all( target_arch = "aarch64" , target_feature = "neon" ) ) ) ]
244
+ #[ cfg( not( bootstrap) ) ]
245
+ #[ cfg( target_has_reliable_f16) ]
243
246
pub fn f16_shortest_sanity_test < F > ( mut f : F )
244
247
where
245
248
F : for < ' a > FnMut ( & Decoded , & ' a mut [ MaybeUninit < u8 > ] ) -> ( & ' a [ u8 ] , i16 ) ,
@@ -287,7 +290,8 @@ where
287
290
check_shortest ! ( f( minf16) => b"6" , -7 ) ;
288
291
}
289
292
290
- #[ cfg( any( target_arch = "x86" , all( target_arch = "aarch64" , target_feature = "neon" ) ) ) ]
293
+ #[ cfg( not( bootstrap) ) ]
294
+ #[ cfg( target_has_reliable_f16) ]
291
295
pub fn f16_exact_sanity_test < F > ( mut f : F )
292
296
where
293
297
F : for < ' a > FnMut ( & Decoded , & ' a mut [ MaybeUninit < u8 > ] , i16 ) -> ( & ' a [ u8 ] , i16 ) ,
@@ -635,7 +639,8 @@ where
635
639
assert_eq ! ( to_string( f, 1.9971e20 , Minus , 1 ) , "199710000000000000000.0" ) ;
636
640
assert_eq ! ( to_string( f, 1.9971e20 , Minus , 8 ) , "199710000000000000000.00000000" ) ;
637
641
638
- #[ cfg( any( target_arch = "x86" , all( target_arch = "aarch64" , target_feature = "neon" ) ) ) ]
642
+ #[ cfg( not( bootstrap) ) ]
643
+ #[ cfg( target_has_reliable_f16) ]
639
644
{
640
645
// f16
641
646
assert_eq ! ( to_string( f, f16:: MAX , Minus , 0 ) , "65500" ) ;
@@ -759,7 +764,8 @@ where
759
764
assert_eq ! ( to_string( f, 1.0e23 , Minus , ( 23 , 24 ) , false ) , "100000000000000000000000" ) ;
760
765
assert_eq ! ( to_string( f, 1.0e23 , Minus , ( 24 , 25 ) , false ) , "1e23" ) ;
761
766
762
- #[ cfg( any( target_arch = "x86" , all( target_arch = "aarch64" , target_feature = "neon" ) ) ) ]
767
+ #[ cfg( not( bootstrap) ) ]
768
+ #[ cfg( target_has_reliable_f16) ]
763
769
{
764
770
// f16
765
771
assert_eq ! ( to_string( f, f16:: MAX , Minus , ( -2 , 2 ) , false ) , "6.55e4" ) ;
@@ -913,7 +919,8 @@ where
913
919
"9.999999999999999547481118258862586856139387236908078193664550781250000e-7"
914
920
) ;
915
921
916
- #[ cfg( any( target_arch = "x86" , all( target_arch = "aarch64" , target_feature = "neon" ) ) ) ]
922
+ #[ cfg( not( bootstrap) ) ]
923
+ #[ cfg( target_has_reliable_f16) ]
917
924
{
918
925
assert_eq ! ( to_string( f, f16:: MAX , Minus , 1 , false ) , "7e4" ) ;
919
926
assert_eq ! ( to_string( f, f16:: MAX , Minus , 2 , false ) , "6.6e4" ) ;
@@ -1211,7 +1218,8 @@ where
1211
1218
"0.000000999999999999999954748111825886258685613938723690807819366455078125000"
1212
1219
) ;
1213
1220
1214
- #[ cfg( any( target_arch = "x86" , all( target_arch = "aarch64" , target_feature = "neon" ) ) ) ]
1221
+ #[ cfg( not( bootstrap) ) ]
1222
+ #[ cfg( target_has_reliable_f16) ]
1215
1223
{
1216
1224
assert_eq ! ( to_string( f, f16:: MAX , Minus , 0 ) , "65504" ) ;
1217
1225
assert_eq ! ( to_string( f, f16:: MAX , Minus , 1 ) , "65504.0" ) ;
@@ -1227,7 +1235,8 @@ where
1227
1235
return ;
1228
1236
}
1229
1237
1230
- #[ cfg( any( target_arch = "x86" , all( target_arch = "aarch64" , target_feature = "neon" ) ) ) ]
1238
+ #[ cfg( not( bootstrap) ) ]
1239
+ #[ cfg( target_has_reliable_f16) ]
1231
1240
{
1232
1241
let minf16 = ldexp_f16 ( 1.0 , -24 ) ;
1233
1242
assert_eq ! ( to_string( f, minf16, Minus , 0 ) , "0" ) ;
0 commit comments