Skip to content

Commit

Permalink
Add a disclaimer about x86 f128 math functions
Browse files Browse the repository at this point in the history
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: llvm/llvm-project#44744
  • Loading branch information
tgross35 committed Aug 1, 2024
1 parent 4383642 commit 8e2ca0c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions library/core/src/primitive_docs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8e2ca0c

Please sign in to comment.