Skip to content

Commit ed04567

Browse files
committed
Auto merge of #129385 - tgross35:more-platforms-enable-f16, r=Mark-Simulacrum
Enable `f16` tests on platforms that were missing conversion symbols The only requirement for `f16` support, aside from LLVM not crashing and no ABI issues, is that symbols to convert to and from `f32` are available. Since the update to compiler-builtins in #125016, we now provide these on all platforms. This also enables `f16` math since there are no further requirements. Still excluded are platforms for which LLVM emits infinitely-recursing code. try-job: arm-android try-job: test-various try-job: x86_64-fuchsia
2 parents a1fd235 + 404c5d2 commit ed04567

File tree

1 file changed

+11
-14
lines changed

1 file changed

+11
-14
lines changed

library/std/build.rs

+11-14
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,6 @@ fn main() {
9696
let has_reliable_f16 = match (target_arch.as_str(), target_os.as_str()) {
9797
// We can always enable these in Miri as that is not affected by codegen bugs.
9898
_ if is_miri => true,
99-
// Selection failure until recent LLVM <https://github.com/llvm/llvm-project/issues/93894>
100-
// FIXME(llvm19): can probably be removed at the version bump
101-
("loongarch64", _) => false,
10299
// Selection failure <https://github.com/llvm/llvm-project/issues/50374>
103100
("s390x", _) => false,
104101
// Unsupported <https://github.com/llvm/llvm-project/issues/94434>
@@ -108,18 +105,18 @@ fn main() {
108105
// Apple has a special ABI for `f16` that we do not yet support
109106
// FIXME(builtins): fixed by <https://github.com/rust-lang/compiler-builtins/pull/675>
110107
("x86" | "x86_64", _) if target_vendor == "apple" => false,
111-
// Missing `__gnu_h2f_ieee` and `__gnu_f2h_ieee`
108+
// Infinite recursion <https://github.com/llvm/llvm-project/issues/97981>
109+
("csky", _) => false,
110+
("hexagon", _) => false,
111+
("loongarch64", _) => false,
112+
("mips" | "mips64" | "mips32r6" | "mips64r6", _) => false,
112113
("powerpc" | "powerpc64", _) => false,
113-
// Missing `__gnu_h2f_ieee` and `__gnu_f2h_ieee`
114-
("mips" | "mips32r6" | "mips64" | "mips64r6", _) => false,
115-
// Missing `__extendhfsf` and `__truncsfhf`
116-
("riscv32" | "riscv64", _) => false,
117-
// Most OSs are missing `__extendhfsf` and `__truncsfhf`
118-
(_, "linux" | "macos") => true,
119-
// Almost all OSs besides Linux and MacOS are missing symbols until compiler-builtins can
120-
// be updated. <https://github.com/rust-lang/rust/pull/125016> will get some of these, the
121-
// next CB update should get the rest.
122-
_ => false,
114+
("sparc" | "sparc64", _) => false,
115+
("wasm32" | "wasm64", _) => false,
116+
// `f16` support only requires that symbols converting to and from `f32` are available. We
117+
// provide these in `compiler-builtins`, so `f16` should be available on all platforms that
118+
// do not have other ABI issues or LLVM crashes.
119+
_ => true,
123120
};
124121

125122
let has_reliable_f128 = match (target_arch.as_str(), target_os.as_str()) {

0 commit comments

Comments
 (0)