@@ -85,6 +85,11 @@ fn main() {
85
85
println ! ( "cargo:rustc-check-cfg=cfg(reliable_f16)" ) ;
86
86
println ! ( "cargo:rustc-check-cfg=cfg(reliable_f128)" ) ;
87
87
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
+
88
93
let has_reliable_f16 = match ( target_arch. as_str ( ) , target_os. as_str ( ) ) {
89
94
// Selection failure until recent LLVM <https://github.com/llvm/llvm-project/issues/93894>
90
95
// FIXME(llvm19): can probably be removed at the version bump
@@ -128,10 +133,29 @@ fn main() {
128
133
_ => false ,
129
134
} ;
130
135
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
+
131
149
if has_reliable_f16 {
132
150
println ! ( "cargo:rustc-cfg=reliable_f16" ) ;
133
151
}
134
152
if has_reliable_f128 {
135
153
println ! ( "cargo:rustc-cfg=reliable_f128" ) ;
136
154
}
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
+ }
137
161
}
0 commit comments