Skip to content

Commit b557938

Browse files
committed
Enable f16 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 [1], we now provide these on all platforms. This also enables `f16` math since there are no further requirements. [1]: #125016
1 parent a32d4a0 commit b557938

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

library/std/build.rs

+4-12
Original file line numberDiff line numberDiff line change
@@ -106,18 +106,10 @@ fn main() {
106106
// x86 has ABI bugs that show up with optimizations. This should be partially fixed with
107107
// the compiler-builtins update. <https://github.com/rust-lang/rust/issues/123885>
108108
("x86" | "x86_64", _) => false,
109-
// Missing `__gnu_h2f_ieee` and `__gnu_f2h_ieee`
110-
("powerpc" | "powerpc64", _) => false,
111-
// Missing `__gnu_h2f_ieee` and `__gnu_f2h_ieee`
112-
("mips" | "mips32r6" | "mips64" | "mips64r6", _) => false,
113-
// Missing `__extendhfsf` and `__truncsfhf`
114-
("riscv32" | "riscv64", _) => false,
115-
// Most OSs are missing `__extendhfsf` and `__truncsfhf`
116-
(_, "linux" | "macos") => true,
117-
// Almost all OSs besides Linux and MacOS are missing symbols until compiler-builtins can
118-
// be updated. <https://github.com/rust-lang/rust/pull/125016> will get some of these, the
119-
// next CB update should get the rest.
120-
_ => false,
109+
// `f16` support only requires that symbols converting to and from `f32` are available. We
110+
// provide these in `compiler-builtins`, so `f16` should be available on all platforms that
111+
// do not have other ABI issues or LLVM crashes.
112+
_ => true,
121113
};
122114

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

0 commit comments

Comments
 (0)