@@ -11,6 +11,7 @@ fn main() {
1111 . expect ( "CARGO_CFG_TARGET_POINTER_WIDTH was not set" )
1212 . parse ( )
1313 . unwrap ( ) ;
14+ let is_miri = env:: var_os ( "CARGO_CFG_MIRI" ) . is_some ( ) ;
1415
1516 println ! ( "cargo:rustc-check-cfg=cfg(netbsd10)" ) ;
1617 if target_os == "netbsd" && env:: var ( "RUSTC_STD_NETBSD10" ) . is_ok ( ) {
@@ -91,6 +92,8 @@ fn main() {
9192 println ! ( "cargo:rustc-check-cfg=cfg(reliable_f128_math)" ) ;
9293
9394 let has_reliable_f16 = match ( target_arch. as_str ( ) , target_os. as_str ( ) ) {
95+ // We can always enable these in Miri as that is not affected by codegen bugs.
96+ _ if is_miri => true ,
9497 // Selection failure until recent LLVM <https://github.com/llvm/llvm-project/issues/93894>
9598 // FIXME(llvm19): can probably be removed at the version bump
9699 ( "loongarch64" , _) => false ,
@@ -118,6 +121,8 @@ fn main() {
118121 } ;
119122
120123 let has_reliable_f128 = match ( target_arch. as_str ( ) , target_os. as_str ( ) ) {
124+ // We can always enable these in Miri as that is not affected by codegen bugs.
125+ _ if is_miri => true ,
121126 // Unsupported <https://github.com/llvm/llvm-project/issues/94434>
122127 ( "arm64ec" , _) => false ,
123128 // ABI and precision bugs <https://github.com/rust-lang/rust/issues/125109>
@@ -141,6 +146,8 @@ fn main() {
141146 // LLVM is currenlty adding missing routines, <https://github.com/llvm/llvm-project/issues/93566>
142147 let has_reliable_f16_math = has_reliable_f16
143148 && match ( target_arch. as_str ( ) , target_os. as_str ( ) ) {
149+ // FIXME: Disabled on Miri as the intrinsics are not implemented yet.
150+ _ if is_miri => false ,
144151 // Currently nothing special. Hooray!
145152 // This will change as platforms gain better better support for standard ops but math
146153 // lags behind.
@@ -149,6 +156,8 @@ fn main() {
149156
150157 let has_reliable_f128_math = has_reliable_f128
151158 && match ( target_arch. as_str ( ) , target_os. as_str ( ) ) {
159+ // FIXME: Disabled on Miri as the intrinsics are not implemented yet.
160+ _ if is_miri => false ,
152161 // LLVM lowers `fp128` math to `long double` symbols even on platforms where
153162 // `long double` is not IEEE binary128. See
154163 // <https://github.com/llvm/llvm-project/issues/44744>.
0 commit comments