[PATCH] D67360: [FPEnv] Document that constrained FP intrinsics cannot be mixed with non-constrained

Kevin P. Neal via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 9 09:54:24 PDT 2019


kpn created this revision.
kpn added reviewers: craig.topper, andrew.w.kaylor, cameron.mcinally, efriedma, hfinkel, uweigand, kbarton.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

It does not appear that we've documented that constrained FP intrinsics cannot be mixed in a single function with non-constrained instructions. This patch fixes that.


Repository:
  rL LLVM

https://reviews.llvm.org/D67360

Files:
  docs/LangRef.rst


Index: docs/LangRef.rst
===================================================================
--- docs/LangRef.rst
+++ docs/LangRef.rst
@@ -15051,11 +15051,16 @@
 accurately preserve exception behavior without compromising LLVM's ability to
 optimize FP code when the default behavior is used.
 
+If any FP operation in a function is constrained then they all must be
+constrained. This is required for correct LLVM IR. There are no FP barrier
+instructions in LLVM IR, and optimizations that move code around can create
+miscompiles if mixing of constrained and normal operations is done.
+
 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
+first 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
+The next argument is a metadata argument specifying the rounding mode to be
 assumed. This argument must be one of the following strings:
 
 ::
@@ -15086,7 +15091,7 @@
 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
+The last argument to the constrained floating-point intrinsics specifies the
 required exception behavior.  This argument must be one of the following
 strings:
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D67360.219377.patch
Type: text/x-patch
Size: 1448 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190909/59dd4875/attachment.bin>


More information about the llvm-commits mailing list