@@ -85,6 +85,11 @@ fn main() {
8585 println ! ( "cargo:rustc-check-cfg=cfg(reliable_f16)" ) ;
8686 println ! ( "cargo:rustc-check-cfg=cfg(reliable_f128)" ) ;
8787
88+ // This is a step above just having the types and basic functions available. Math functions
89+ // aren't consistently available or correct.
90+ println ! ( "cargo:rustc-check-cfg=cfg(reliable_f16_math)" ) ;
91+ println ! ( "cargo:rustc-check-cfg=cfg(reliable_f128_math)" ) ;
92+
8893 let has_reliable_f16 = match ( target_arch. as_str ( ) , target_os. as_str ( ) ) {
8994 // Selection failure until recent LLVM <https://github.com/llvm/llvm-project/issues/93894>
9095 // FIXME(llvm19): can probably be removed at the version bump
@@ -128,10 +133,29 @@ fn main() {
128133 _ => false ,
129134 } ;
130135
136+ // LLVM is currenlty adding missing routines, <https://github.com/llvm/llvm-project/issues/93566>
137+ let has_reliable_f16_math = has_reliable_f16
138+ && match ( target_arch. as_str ( ) , target_os. as_str ( ) ) {
139+ ( "aarch64" , _) => true ,
140+ _ => false ,
141+ } ;
142+
143+ let has_reliable_f128_math = has_reliable_f128
144+ && match ( target_arch. as_str ( ) , target_os. as_str ( ) ) {
145+ ( "aarch64" , _) => true ,
146+ _ => false ,
147+ } ;
148+
131149 if has_reliable_f16 {
132150 println ! ( "cargo:rustc-cfg=reliable_f16" ) ;
133151 }
134152 if has_reliable_f128 {
135153 println ! ( "cargo:rustc-cfg=reliable_f128" ) ;
136154 }
155+ if has_reliable_f16_math {
156+ println ! ( "cargo:rustc-cfg=reliable_f16_math" ) ;
157+ }
158+ if has_reliable_f128_math {
159+ println ! ( "cargo:rustc-cfg=reliable_f128_math" ) ;
160+ }
137161}
0 commit comments