diff --git a/configure.rs b/configure.rs index f8aafbe7..0a0bd503 100644 --- a/configure.rs +++ b/configure.rs @@ -51,31 +51,46 @@ impl Target { /// Configure whether or not `f16` and `f128` support should be enabled. pub fn configure_f16_f128(target: &Target) { // Set whether or not `f16` and `f128` are supported at a basic level by LLVM. This only means - // that the backend will not crash when using these types. This does not mean that the - // backend does the right thing, or that the platform doesn't have ABI bugs. + // that the backend will not crash when using these types and generates code that can be called + // without crashing (no infinite recursion). This does not mean that the platform doesn't have + // ABI or other bugs. // // We do this here rather than in `rust-lang/rust` because configuring via cargo features is // not straightforward. // // Original source of this list: // - let (f16_ok, f128_ok) = match target.arch.as_str() { - // `f16` and `f128` both crash - "arm64ec" => (false, false), - // `f16` crashes - "s390x" => (false, true), - // FIXME(llvm): `f16` test failures fixed by - "loongarch64" => (false, true), - // `f128` crashes - "mips64" | "mips64r6" => (true, false), - // `f128` crashes - "powerpc64" if &target.os == "aix" => (true, false), - // `f128` crashes - "sparc" => (true, false), - // `f16` miscompiles - "wasm32" | "wasm64" => (false, true), + let f16_enabled = match target.arch.as_str() { + // Unsupported + "arm64ec" => false, + // Selection failure + "s390x" => false, + // Infinite recursion + // FIXME(llvm): loongarch fixed by + "csky" => false, + "hexagon" => false, + "loongarch64" => false, + "mips" | "mips64" | "mips32r6" | "mips64r6" => false, + "powerpc" | "powerpc64" => false, + "sparc" | "sparc64" => false, + "wasm32" | "wasm64" => false, // Most everything else works as of LLVM 19 - _ => (true, true), + _ => true, + }; + + let f128_enabled = match target.arch.as_str() { + // Unsupported + "arm64ec" => false, + // Selection failure + "mips64" | "mips64r6" => false, + // Selection failure + "nvptx64" => false, + // Selection failure + "powerpc64" if &target.os == "aix" => false, + // Selection failure + "sparc" => false, + // Most everything else works as of LLVM 19 + _ => true, }; // If the feature is set, disable these types. @@ -84,11 +99,11 @@ pub fn configure_f16_f128(target: &Target) { println!("cargo::rustc-check-cfg=cfg(f16_enabled)"); println!("cargo::rustc-check-cfg=cfg(f128_enabled)"); - if f16_ok && !disable_both { + if f16_enabled && !disable_both { println!("cargo::rustc-cfg=f16_enabled"); } - if f128_ok && !disable_both { + if f128_enabled && !disable_both { println!("cargo::rustc-cfg=f128_enabled"); } }