Skip to content

Commit 4e6b44d

Browse files
committed
Enable f16 tests on x86 and x86-64
Since the `compiler_builtins` update [1], ABI bugs on x86 should be resolved. Enable tests for f16 on these platforms now. `f16` math functions (`reliable_f16_math`) are still excluded because there is an LLVM crash for powi [2]. [1]: rust-lang#125016 [2]: llvm/llvm-project#105747
1 parent 5ad98b4 commit 4e6b44d

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

library/std/build.rs

+6-9
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,7 @@ fn main() {
102102
// Unsupported <https://github.com/llvm/llvm-project/issues/94434>
103103
("arm64ec", _) => false,
104104
// MinGW ABI bugs <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115054>
105-
("x86_64", "windows") => false,
106-
// x86 has ABI bugs that show up with optimizations. This should be partially fixed with
107-
// the compiler-builtins update. <https://github.com/rust-lang/rust/issues/123885>
108-
("x86" | "x86_64", _) => false,
105+
("x86" | "x86_64", "windows") => false,
109106
// Missing `__gnu_h2f_ieee` and `__gnu_f2h_ieee`
110107
("powerpc" | "powerpc64", _) => false,
111108
// Missing `__gnu_h2f_ieee` and `__gnu_f2h_ieee`
@@ -140,17 +137,17 @@ fn main() {
140137
_ => false,
141138
};
142139

143-
// These are currently empty, but will fill up as some platforms move from completely
144-
// unreliable to reliable basics but unreliable math.
140+
// Configure platforms that have reliable basics but may have unreliable math.
145141

146142
// LLVM is currenlty adding missing routines, <https://github.com/llvm/llvm-project/issues/93566>
147143
let has_reliable_f16_math = has_reliable_f16
148144
&& match (target_arch.as_str(), target_os.as_str()) {
149145
// FIXME: Disabled on Miri as the intrinsics are not implemented yet.
150146
_ if is_miri => false,
151-
// Currently nothing special. Hooray!
152-
// This will change as platforms gain better better support for standard ops but math
153-
// lags behind.
147+
// x86 has a crash for `powi`: <https://github.com/llvm/llvm-project/issues/105747>
148+
("x86" | "x86_64", _) => false,
149+
// Assume that working `f16` means working `f16` math for most platforms, since
150+
// operations just go through `f32`.
154151
_ => true,
155152
};
156153

0 commit comments

Comments
 (0)