From 8e2ca0c9d500ea435fbf9858a4d8cec8ee7dfde3 Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Tue, 30 Jul 2024 18:11:46 -0400 Subject: [PATCH] Add a disclaimer about x86 `f128` math functions Due to a LLVM bug, `f128` math functions link successfully but LLVM chooses the wrong symbols (`long double` symbols rather than those for binary128). Since this is a notable problem that may surprise a number of users, add a note about it. Link: https://github.com/llvm/llvm-project/issues/44744 --- library/core/src/primitive_docs.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/library/core/src/primitive_docs.rs b/library/core/src/primitive_docs.rs index 5989bcbcc5201..09ebef89fb0c2 100644 --- a/library/core/src/primitive_docs.rs +++ b/library/core/src/primitive_docs.rs @@ -1244,6 +1244,9 @@ mod prim_f64 {} /// actually implement it. For x86-64 and AArch64, ISA support is not even specified, /// so it will always be a software implementation significantly slower than `f64`. /// +/// _Note: `f128` support is incomplete. Many platforms will not be able to link math functions. On +/// x86 in particular, these functions do link but their results are always incorrect._ +/// /// *[See also the `std::f128::consts` module](crate::f128::consts).* /// /// [wikipedia]: https://en.wikipedia.org/wiki/Quadruple-precision_floating-point_format