diff options
author | Ralf Jung <post@ralfj.de> | 2024-01-09 21:41:24 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-09 12:41:24 -0800 |
commit | fb1466216889e9f4d884a387f430d2e85b4542f6 (patch) | |
tree | 5c59a055541bfb3d12126643303ce4609c3a56e0 /llvm/docs/LangRef.rst | |
parent | 47605ffec8864e989905027b2f56277e2dc8b8fa (diff) | |
download | llvm-fb1466216889e9f4d884a387f430d2e85b4542f6.zip llvm-fb1466216889e9f4d884a387f430d2e85b4542f6.tar.gz llvm-fb1466216889e9f4d884a387f430d2e85b4542f6.tar.bz2 |
LangRef: rint, nearbyint: mention that default rounding mode is assumed (#77191)
LLVM assumes round-to-nearest mode and sometimes performs constant-folding based on that assumption. This updates the language ref documentation for the rint and nearbyint intrinsics to mention that fact.
Diffstat (limited to 'llvm/docs/LangRef.rst')
-rw-r--r-- | llvm/docs/LangRef.rst | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst index c90b6be..2722333 100644 --- a/llvm/docs/LangRef.rst +++ b/llvm/docs/LangRef.rst @@ -15754,7 +15754,11 @@ Semantics: """""""""" This function returns the same values as the libm ``rint`` functions -would, and handles error conditions in the same way. +would, and handles error conditions in the same way. Since LLVM assumes the +:ref:`default floating-point environment <floatenv>`, the rounding mode is +assumed to be set to "nearest", so halfway cases are rounded to the even +integer. Use :ref:`Constrained Floating-Point Intrinsics <constrainedfp>` +to avoid that assumption. .. _int_nearbyint: @@ -15792,7 +15796,11 @@ Semantics: """""""""" This function returns the same values as the libm ``nearbyint`` -functions would, and handles error conditions in the same way. +functions would, and handles error conditions in the same way. Since LLVM +assumes the :ref:`default floating-point environment <floatenv>`, the rounding +mode is assumed to be set to "nearest", so halfway cases are rounded to the even +integer. Use :ref:`Constrained Floating-Point Intrinsics <constrainedfp>` to +avoid that assumption. .. _int_round: |