@@ -15064,12 +15064,21 @@ Constrained FP intrinsics are used to support non-default rounding modes and
15064
15064
accurately preserve exception behavior without compromising LLVM's ability to
15065
15065
optimize FP code when the default behavior is used.
15066
15066
15067
- Each of these intrinsics corresponds to a normal floating-point operation. The
15068
- first two arguments and the return value are the same as the corresponding FP
15067
+ If any FP operation in a function is constrained then they all must be
15068
+ constrained. This is required for correct LLVM IR. Optimizations that
15069
+ move code around can create miscompiles if mixing of constrained and normal
15070
+ operations is done. The correct way to mix constrained and less constrained
15071
+ operations is to use the rounding mode and exception handling metadata to
15072
+ mark constrained intrinsics as having LLVM's default behavior.
15073
+
15074
+ Each of these intrinsics corresponds to a normal floating-point operation. The
15075
+ data arguments and the return value are the same as the corresponding FP
15069
15076
operation.
15070
15077
15071
- The third argument is a metadata argument specifying the rounding mode to be
15072
- assumed. This argument must be one of the following strings:
15078
+ The rounding mode argument is a metadata string specifying what
15079
+ assumptions, if any, the optimizer can make when transforming constant
15080
+ values. Some constrained FP intrinsics omit this argument. If required
15081
+ by the intrinsic, this argument must be one of the following strings:
15073
15082
15074
15083
::
15075
15084
@@ -15099,9 +15108,9 @@ the specified rounding mode, but this is not guaranteed. Using a specific
15099
15108
non-dynamic rounding mode which does not match the actual rounding mode at
15100
15109
runtime results in undefined behavior.
15101
15110
15102
- The fourth argument to the constrained floating-point intrinsics specifies the
15103
- required exception behavior. This argument must be one of the following
15104
- strings:
15111
+ The exception behavior argument is a metadata string describing the floating
15112
+ point exception semantics that required for the intrinsic. This argument
15113
+ must be one of the following strings:
15105
15114
15106
15115
::
15107
15116
0 commit comments