Skip to content

Commit 402ce53

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]: #125016 [2]: llvm/llvm-project#105747
1 parent a60a9e5 commit 402ce53

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

library/std/build.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,9 @@ fn main() {
103103
("arm64ec", _) => false,
104104
// MinGW ABI bugs <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115054>
105105
("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,
106+
// Apple has a special ABI for `f16` that we do not yet support
107+
// FIXME(builtins): fixed by <https://github.com/rust-lang/compiler-builtins/pull/675>
108+
("x86" | "x86_64", _) if target_vendor == "apple" => false,
109109
// Missing `__gnu_h2f_ieee` and `__gnu_f2h_ieee`
110110
("powerpc" | "powerpc64", _) => false,
111111
// Missing `__gnu_h2f_ieee` and `__gnu_f2h_ieee`
@@ -140,17 +140,17 @@ fn main() {
140140
_ => false,
141141
};
142142

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

146145
// LLVM is currenlty adding missing routines, <https://github.com/llvm/llvm-project/issues/93566>
147146
let has_reliable_f16_math = has_reliable_f16
148147
&& match (target_arch.as_str(), target_os.as_str()) {
149148
// FIXME: Disabled on Miri as the intrinsics are not implemented yet.
150149
_ 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.
150+
// x86 has a crash for `powi`: <https://github.com/llvm/llvm-project/issues/105747>
151+
("x86" | "x86_64", _) => false,
152+
// Assume that working `f16` means working `f16` math for most platforms, since
153+
// operations just go through `f32`.
154154
_ => true,
155155
};
156156

0 commit comments

Comments
 (0)