summaryrefslogtreecommitdiffstats
path: root/llvm/docs/LangRef.rst
diff options
context:
space:
mode:
authorKevin P. Neal <kevin.neal@sas.com>2019-09-13 19:36:19 +0000
committerKevin P. Neal <kevin.neal@sas.com>2019-09-13 19:36:19 +0000
commited73d4aba87db88afb3e41a8edccf7b768c3a589 (patch)
treeff6b369e7d43350d02192f7db6a6feada519becb /llvm/docs/LangRef.rst
parentd93e136be14c49e612bbf7e4e0a388409a93295c (diff)
downloadbcm5719-llvm-ed73d4aba87db88afb3e41a8edccf7b768c3a589.tar.gz
bcm5719-llvm-ed73d4aba87db88afb3e41a8edccf7b768c3a589.zip
[FPEnv] Document that constrained FP intrinsics cannot be mixed with non-constrained
Reviewed by: andrew.w.kaylor, cameron.mcinally, uweigand Approved by: andrew.w.kaylor Differential Revision: https://reviews.llvm.org/D67360 llvm-svn: 371888
Diffstat (limited to 'llvm/docs/LangRef.rst')
-rw-r--r--llvm/docs/LangRef.rst23
1 files changed, 16 insertions, 7 deletions
diff --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst
index 03b017c94b5..e6c1bf10298 100644
--- a/llvm/docs/LangRef.rst
+++ b/llvm/docs/LangRef.rst
@@ -15064,12 +15064,21 @@ Constrained FP intrinsics are used to support non-default rounding modes and
accurately preserve exception behavior without compromising LLVM's ability to
optimize FP code when the default behavior is used.
-Each of these intrinsics corresponds to a normal floating-point operation. The
-first two arguments and the return value are the same as the corresponding FP
+If any FP operation in a function is constrained then they all must be
+constrained. This is required for correct LLVM IR. Optimizations that
+move code around can create miscompiles if mixing of constrained and normal
+operations is done. The correct way to mix constrained and less constrained
+operations is to use the rounding mode and exception handling metadata to
+mark constrained intrinsics as having LLVM's default behavior.
+
+Each of these intrinsics corresponds to a normal floating-point operation. The
+data arguments and the return value are the same as the corresponding FP
operation.
-The third argument is a metadata argument specifying the rounding mode to be
-assumed. This argument must be one of the following strings:
+The rounding mode argument is a metadata string specifying what
+assumptions, if any, the optimizer can make when transforming constant
+values. Some constrained FP intrinsics omit this argument. If required
+by the intrinsic, this argument must be one of the following strings:
::
@@ -15099,9 +15108,9 @@ the specified rounding mode, but this is not guaranteed. Using a specific
non-dynamic rounding mode which does not match the actual rounding mode at
runtime results in undefined behavior.
-The fourth argument to the constrained floating-point intrinsics specifies the
-required exception behavior. This argument must be one of the following
-strings:
+The exception behavior argument is a metadata string describing the floating
+point exception semantics that required for the intrinsic. This argument
+must be one of the following strings:
::
OpenPOWER on IntegriCloud