Skip to content

Commit

Permalink
Configure f16 and f128 support for WebAssembly
Browse files Browse the repository at this point in the history
  • Loading branch information
kleisauke committed Aug 11, 2024
1 parent 3ad4d9c commit 6a80b90
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,8 @@ fn configure_f16_f128(target: &Target) {
"powerpc64" if &target.os == "aix" => (true, false),
// `f128` crashes <https://github.com/llvm/llvm-project/issues/41838>
"sparc" | "sparcv9" => (true, false),
// `f16` miscompiles <https://github.com/llvm/llvm-project/issues/96438>
"wasm32" | "wasm64" => (false, true),
// Most everything else works as of LLVM 19
_ => (true, true),
};
Expand Down
5 changes: 3 additions & 2 deletions testcrate/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
// <https://github.com/llvm/llvm-project/issues/96438>.
|| target.starts_with("wasm")
{
features.insert(Feature::NoSysF16);
features.insert(Feature::NoSysF16F128Convert);
Expand Down

0 comments on commit 6a80b90

Please sign in to comment.