From 5dad727bdc9aa69145cd48c08c42b8e878a3c84b Mon Sep 17 00:00:00 2001 From: Kleis Auke Wolthuizen Date: Sun, 11 Aug 2024 11:36:25 +0200 Subject: [PATCH] Configure `f16` and `f128` support for WebAssembly --- library/compiler-builtins/build.rs | 2 ++ library/compiler-builtins/testcrate/build.rs | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/library/compiler-builtins/build.rs b/library/compiler-builtins/build.rs index 93e323e6b236..56716b906aba 100644 --- a/library/compiler-builtins/build.rs +++ b/library/compiler-builtins/build.rs @@ -283,6 +283,8 @@ fn configure_f16_f128(target: &Target) { "powerpc64" if &target.os == "aix" => (true, false), // `f128` crashes "sparc" | "sparcv9" => (true, false), + // `f16` miscompiles + "wasm32" | "wasm64" => (false, true), // Most everything else works as of LLVM 19 _ => (true, true), }; diff --git a/library/compiler-builtins/testcrate/build.rs b/library/compiler-builtins/testcrate/build.rs index 8c441de8a958..74d74559ef67 100644 --- a/library/compiler-builtins/testcrate/build.rs +++ b/library/compiler-builtins/testcrate/build.rs @@ -54,8 +54,9 @@ fn main() { || target.starts_with("i586-") || target.contains("windows-") // Linking says "error: function signature mismatch: __extendhfsf2" and seems to - // think the signature is either `(i32) -> f32` or `(f32) -> f32` - || target.starts_with("wasm32-") + // think the signature is either `(i32) -> f32` or `(f32) -> f32`. See + // . + || target.starts_with("wasm") { features.insert(Feature::NoSysF16); features.insert(Feature::NoSysF16F128Convert);