@@ -3577,6 +3577,12 @@ seq\_cst total orderings of other operations that are not marked
3577
3577
Floating-Point Environment
3578
3578
--------------------------
3579
3579
3580
+ Unless noted otherwise, LLVM works with IEEE-754 floating-point semantics: LLVM
3581
+ backends assume that the CPU is configured to provide IEEE-compatible behavior,
3582
+ and LLVM frontends can assume that LLVM IR floating-point operations behave
3583
+ according to the IEEE specification (with an :ref:`exception around NaN values
3584
+ <floatnan>`).
3585
+
3580
3586
The default LLVM floating-point environment assumes that traps are disabled and
3581
3587
status flags are not observable. Therefore, floating-point math operations do
3582
3588
not have side effects and may be speculated freely. Results assume the
@@ -3608,10 +3614,11 @@ are not "floating-point math operations": ``fneg``, ``llvm.fabs``, and
3608
3614
``llvm.copysign``. These operations act directly on the underlying bit
3609
3615
representation and never change anything except possibly for the sign bit.
3610
3616
3611
- For floating-point math operations, unless specified otherwise, the following
3612
- rules apply when a NaN value is returned: the result has a non-deterministic
3613
- sign; the quiet bit and payload are non-deterministically chosen from the
3614
- following set of options:
3617
+ Floating-point math operations that return a NaN are an exception from the
3618
+ general principle that LLVM implements IEEE-754 semantics. Unless specified
3619
+ otherwise, the following rules apply when a NaN value is returned: the result
3620
+ has a non-deterministic sign; the quiet bit and payload are
3621
+ non-deterministically chosen from the following set of options:
3615
3622
3616
3623
- The quiet bit is set and the payload is all-zero. ("Preferred NaN" case)
3617
3624
- The quiet bit is set and the payload is copied from any input operand that is
0 commit comments