[llvm] LangRef: state explicitly that floats generally behave according to IEEE-754 (PR #102140)
Ralf Jung via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 21 01:24:34 PDT 2024
================
@@ -3572,6 +3572,29 @@ or ``syncscope("<target-scope>")`` *synchronizes with* and participates in the
seq\_cst total orderings of other operations that are not marked
``syncscope("singlethread")`` or ``syncscope("<target-scope>")``.
+.. _floatsem:
+
+Floating-Point Semantics
+------------------------
+
+LLVM floating-point types fall into two categories:
+
+- half, float, double, and fp128, which correspond to the binary16, binary32,
+ binary64, and binary128 formats described in the IEEE-754 specification.
+- The remaining types, which do not directly correspond to a standard IEEE
+ format.
+
+For types that do correspond to an IEEE format, LLVM IR float operations behave
+like the corresponding operations in IEEE-754, with two exceptions: LLVM makes
+:ref:`specific assumptions about the state of the floating-point environment
+<floatenv>` and it implements :ref:`different rules for operations that return
+NaN values <floatnan>`.
----------------
RalfJung wrote:
I gave it a shot, based on your suggestion but structuring things a bit differently.
https://github.com/llvm/llvm-project/pull/102140
More information about the llvm-commits
mailing list