Skip to content

Commit a22bdee

Browse files
committed
Disable f16 portable-simd tests on x86_64-pc-windows-gnu
Taken from rust-lang/portable-simd#520
1 parent ff5d860 commit a22bdee

1 file changed

Lines changed: 46 additions & 0 deletions

File tree

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
From 1f19d30c40349566cbb9eb713db771ef73806943 Mon Sep 17 00:00:00 2001
2+
From: Folkert de Vries <folkert@folkertdev.nl>
3+
Date: Thu, 16 Apr 2026 15:56:54 +0200
4+
Subject: [PATCH] disable `f16` tests for the cranelift backend
5+
6+
---
7+
crates/core_simd/Cargo.toml | 8 ++++++++
8+
crates/core_simd/tests/f16_ops.rs | 5 +++++
9+
2 files changed, 13 insertions(+)
10+
11+
diff --git a/crates/core_simd/Cargo.toml b/crates/core_simd/Cargo.toml
12+
index 6e576084ecf..05fc63a6a29 100644
13+
--- a/crates/core_simd/Cargo.toml
14+
+++ b/crates/core_simd/Cargo.toml
15+
@@ -31,3 +31,11 @@ path = "../test_helpers"
16+
17+
[dev-dependencies]
18+
std_float = { path = "../std_float/", features = ["as_crate"] }
19+
+
20+
+[lints.rust.unexpected_cfgs]
21+
+level = "warn"
22+
+check-cfg = [
23+
+ # Internal features aren't marked known config by default, we use these to
24+
+ # gate tests.
25+
+ 'cfg(target_has_reliable_f16_math)',
26+
+]
27+
diff --git a/crates/core_simd/tests/f16_ops.rs b/crates/core_simd/tests/f16_ops.rs
28+
index f89bdf4738f..415fffb3af2 100644
29+
--- a/crates/core_simd/tests/f16_ops.rs
30+
+++ b/crates/core_simd/tests/f16_ops.rs
31+
@@ -1,5 +1,7 @@
32+
#![feature(portable_simd)]
33+
#![feature(f16)]
34+
+#![expect(internal_features)]
35+
+#![feature(cfg_target_has_reliable_f16_f128)]
36+
37+
#[macro_use]
38+
mod ops_macros;
39+
@@ -7,4 +9,7 @@ mod ops_macros;
40+
// FIXME: some f16 operations cause rustc to hang on wasm simd
41+
// https://github.com/llvm/llvm-project/issues/189251
42+
#[cfg(not(all(target_arch = "wasm32", target_feature = "simd128")))]
43+
+// FIXME: the cranelift backend runs these tests for x86_64-pc-windows-gnu
44+
+// where it does not have full support for f16 yet.
45+
+#[cfg(target_has_reliable_f16_math)]
46+
impl_float_tests! { f16, i16 }

0 commit comments

Comments
 (0)