@@ -75,7 +75,8 @@ macro_rules! try_fixed {
7575 } )
7676}
7777
78- #[ cfg( any( target_arch = "x86" , all( target_arch = "aarch64" , target_feature = "neon" ) ) ) ]
78+ #[ cfg( not( bootstrap) ) ]
79+ #[ cfg( target_has_reliable_f16) ]
7980fn ldexp_f16 ( a : f16 , b : i32 ) -> f16 {
8081 ldexp_f64 ( a as f64 , b) as f16
8182}
@@ -181,7 +182,8 @@ trait TestableFloat: DecodableFloat + fmt::Display {
181182 fn ldexpi ( f : i64 , exp : isize ) -> Self ;
182183}
183184
184- #[ cfg( any( target_arch = "x86" , all( target_arch = "aarch64" , target_feature = "neon" ) ) ) ]
185+ #[ cfg( not( bootstrap) ) ]
186+ #[ cfg( target_has_reliable_f16) ]
185187impl TestableFloat for f16 {
186188 fn ldexpi ( f : i64 , exp : isize ) -> Self {
187189 f as Self * ( exp as Self ) . exp2 ( )
@@ -239,7 +241,8 @@ macro_rules! check_exact_one {
239241// ftp://ftp.ee.lbl.gov/testbase-report.ps.Z
240242// or https://www.icir.org/vern/papers/testbase-report.pdf
241243
242- #[ cfg( any( target_arch = "x86" , all( target_arch = "aarch64" , target_feature = "neon" ) ) ) ]
244+ #[ cfg( not( bootstrap) ) ]
245+ #[ cfg( target_has_reliable_f16) ]
243246pub fn f16_shortest_sanity_test < F > ( mut f : F )
244247where
245248 F : for < ' a > FnMut ( & Decoded , & ' a mut [ MaybeUninit < u8 > ] ) -> ( & ' a [ u8 ] , i16 ) ,
@@ -287,7 +290,8 @@ where
287290 check_shortest ! ( f( minf16) => b"6" , -7 ) ;
288291}
289292
290- #[ cfg( any( target_arch = "x86" , all( target_arch = "aarch64" , target_feature = "neon" ) ) ) ]
293+ #[ cfg( not( bootstrap) ) ]
294+ #[ cfg( target_has_reliable_f16) ]
291295pub fn f16_exact_sanity_test < F > ( mut f : F )
292296where
293297 F : for < ' a > FnMut ( & Decoded , & ' a mut [ MaybeUninit < u8 > ] , i16 ) -> ( & ' a [ u8 ] , i16 ) ,
@@ -635,7 +639,8 @@ where
635639 assert_eq ! ( to_string( f, 1.9971e20 , Minus , 1 ) , "199710000000000000000.0" ) ;
636640 assert_eq ! ( to_string( f, 1.9971e20 , Minus , 8 ) , "199710000000000000000.00000000" ) ;
637641
638- #[ cfg( any( target_arch = "x86" , all( target_arch = "aarch64" , target_feature = "neon" ) ) ) ]
642+ #[ cfg( not( bootstrap) ) ]
643+ #[ cfg( target_has_reliable_f16) ]
639644 {
640645 // f16
641646 assert_eq ! ( to_string( f, f16:: MAX , Minus , 0 ) , "65500" ) ;
@@ -759,7 +764,8 @@ where
759764 assert_eq ! ( to_string( f, 1.0e23 , Minus , ( 23 , 24 ) , false ) , "100000000000000000000000" ) ;
760765 assert_eq ! ( to_string( f, 1.0e23 , Minus , ( 24 , 25 ) , false ) , "1e23" ) ;
761766
762- #[ cfg( any( target_arch = "x86" , all( target_arch = "aarch64" , target_feature = "neon" ) ) ) ]
767+ #[ cfg( not( bootstrap) ) ]
768+ #[ cfg( target_has_reliable_f16) ]
763769 {
764770 // f16
765771 assert_eq ! ( to_string( f, f16:: MAX , Minus , ( -2 , 2 ) , false ) , "6.55e4" ) ;
@@ -913,7 +919,8 @@ where
913919 "9.999999999999999547481118258862586856139387236908078193664550781250000e-7"
914920 ) ;
915921
916- #[ cfg( any( target_arch = "x86" , all( target_arch = "aarch64" , target_feature = "neon" ) ) ) ]
922+ #[ cfg( not( bootstrap) ) ]
923+ #[ cfg( target_has_reliable_f16) ]
917924 {
918925 assert_eq ! ( to_string( f, f16:: MAX , Minus , 1 , false ) , "7e4" ) ;
919926 assert_eq ! ( to_string( f, f16:: MAX , Minus , 2 , false ) , "6.6e4" ) ;
@@ -1211,7 +1218,8 @@ where
12111218 "0.000000999999999999999954748111825886258685613938723690807819366455078125000"
12121219 ) ;
12131220
1214- #[ cfg( any( target_arch = "x86" , all( target_arch = "aarch64" , target_feature = "neon" ) ) ) ]
1221+ #[ cfg( not( bootstrap) ) ]
1222+ #[ cfg( target_has_reliable_f16) ]
12151223 {
12161224 assert_eq ! ( to_string( f, f16:: MAX , Minus , 0 ) , "65504" ) ;
12171225 assert_eq ! ( to_string( f, f16:: MAX , Minus , 1 ) , "65504.0" ) ;
@@ -1227,7 +1235,8 @@ where
12271235 return ;
12281236 }
12291237
1230- #[ cfg( any( target_arch = "x86" , all( target_arch = "aarch64" , target_feature = "neon" ) ) ) ]
1238+ #[ cfg( not( bootstrap) ) ]
1239+ #[ cfg( target_has_reliable_f16) ]
12311240 {
12321241 let minf16 = ldexp_f16 ( 1.0 , -24 ) ;
12331242 assert_eq ! ( to_string( f, minf16, Minus , 0 ) , "0" ) ;
0 commit comments