about summary refs log tree commit diff
diff options
context:
space:
mode:
authorTrevor Gross <tmgross@umich.edu>2024-07-30 18:11:46 -0400
committerTrevor Gross <tmgross@umich.edu>2024-08-01 15:38:53 -0400
commit8e2ca0c9d500ea435fbf9858a4d8cec8ee7dfde3 (patch)
tree2265067e15a36eaa99529325b4d5f50502893448
parent43836421f8ddb872976f50e05f164b27159966c5 (diff)
downloadrust-8e2ca0c9d500ea435fbf9858a4d8cec8ee7dfde3.tar.gz
rust-8e2ca0c9d500ea435fbf9858a4d8cec8ee7dfde3.zip
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
-rw-r--r--library/core/src/primitive_docs.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/library/core/src/primitive_docs.rs b/library/core/src/primitive_docs.rs
index 5989bcbcc52..09ebef89fb0 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