Skip to content

Commit

Permalink
Auto merge of rust-lang#129385 - tgross35:more-platforms-enable-f16, …
Browse files Browse the repository at this point in the history
…r=<try>

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 rust-lang#125016, we now provide these on all platforms.

This also enables `f16` math since there are no further requirements.

try-job: arm-android
try-job: test-various
try-job: x86_64-fuchsia
  • Loading branch information
bors committed Sep 27, 2024
2 parents fa724e5 + 404c5d2 commit 5d4a2b6
Showing 1 changed file with 11 additions and 14 deletions.
25 changes: 11 additions & 14 deletions library/std/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,6 @@ fn main() {
let has_reliable_f16 = match (target_arch.as_str(), target_os.as_str()) {
// We can always enable these in Miri as that is not affected by codegen bugs.
_ if is_miri => true,
// Selection failure until recent LLVM <https:/llvm/llvm-project/issues/93894>
// FIXME(llvm19): can probably be removed at the version bump
("loongarch64", _) => false,
// Selection failure <https:/llvm/llvm-project/issues/50374>
("s390x", _) => false,
// Unsupported <https:/llvm/llvm-project/issues/94434>
Expand All @@ -108,18 +105,18 @@ fn main() {
// Apple has a special ABI for `f16` that we do not yet support
// FIXME(builtins): fixed by <https:/rust-lang/compiler-builtins/pull/675>
("x86" | "x86_64", _) if target_vendor == "apple" => false,
// Missing `__gnu_h2f_ieee` and `__gnu_f2h_ieee`
// Infinite recursion <https:/llvm/llvm-project/issues/97981>
("csky", _) => false,
("hexagon", _) => false,
("loongarch64", _) => false,
("mips" | "mips64" | "mips32r6" | "mips64r6", _) => false,
("powerpc" | "powerpc64", _) => false,
// Missing `__gnu_h2f_ieee` and `__gnu_f2h_ieee`
("mips" | "mips32r6" | "mips64" | "mips64r6", _) => false,
// Missing `__extendhfsf` and `__truncsfhf`
("riscv32" | "riscv64", _) => false,
// Most OSs are missing `__extendhfsf` and `__truncsfhf`
(_, "linux" | "macos") => true,
// Almost all OSs besides Linux and MacOS are missing symbols until compiler-builtins can
// be updated. <https:/rust-lang/rust/pull/125016> will get some of these, the
// next CB update should get the rest.
_ => false,
("sparc" | "sparc64", _) => false,
("wasm32" | "wasm64", _) => false,
// `f16` support only requires that symbols converting to and from `f32` are available. We
// provide these in `compiler-builtins`, so `f16` should be available on all platforms that
// do not have other ABI issues or LLVM crashes.
_ => true,
};

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

0 comments on commit 5d4a2b6

Please sign in to comment.