@@ -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 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
+
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
@@ -126,10 +131,29 @@ fn main() {
126
131
_ => false ,
127
132
} ;
128
133
134
+ // LLVM is currenlty adding missing routines, <https://github.com/llvm/llvm-project/issues/93566>
135
+ let has_reliable_f16_math = has_reliable_f16
136
+ && match ( target_arch. as_str ( ) , target_os. as_str ( ) ) {
137
+ ( "aarch64" , _) => true ,
138
+ _ => false ,
139
+ } ;
140
+
141
+ let has_reliable_f128_math = has_reliable_f128
142
+ && match ( target_arch. as_str ( ) , target_os. as_str ( ) ) {
143
+ ( "aarch64" , _) => true ,
144
+ _ => false ,
145
+ } ;
146
+
129
147
if has_reliable_f16 {
130
148
println ! ( "cargo:rustc-cfg=reliable_f16" ) ;
131
149
}
132
150
if has_reliable_f128 {
133
151
println ! ( "cargo:rustc-cfg=reliable_f128" ) ;
134
152
}
153
+ if has_reliable_f16_math {
154
+ println ! ( "cargo:rustc-cfg=reliable_f16_math" ) ;
155
+ }
156
+ if has_reliable_f128_math {
157
+ println ! ( "cargo:rustc-cfg=reliable_f128_math" ) ;
158
+ }
135
159
}
0 commit comments