@@ -85,6 +85,11 @@ fn main() {
8585println ! ( "cargo:rustc-check-cfg=cfg(reliable_f16)" ) ;
8686println ! ( "cargo:rustc-check-cfg=cfg(reliable_f128)" ) ;
8787
88+ // This is a step beyond only 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+
8893let 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+ ( "x86" , _) =>false ,
140+ _ =>true ,
141+ } ;
142+
143+ let has_reliable_f128_math = has_reliable_f128
144+ &&match ( target_arch. as_str ( ) , target_os. as_str ( ) ) {
145+ // ("aarch64", _) => false,
146+ _ =>true ,
147+ } ;
148+
131149if has_reliable_f16{
132150println ! ( "cargo:rustc-cfg=reliable_f16" ) ;
133151}
134152if has_reliable_f128{
135153println ! ( "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}