[llvm] [LangRef] make consequences of NaN rules for pow(i) more explicit (PR #170177)

Ralf Jung via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 2 23:58:22 PST 2025


================
@@ -16831,6 +16836,11 @@ trapping or setting ``errno``.
 When specified with the fast-math-flag 'afn', the result may be approximated
 using a less accurate calculation.
 
+Note that due to how :ref:`LLVM treats NaN values <floatnan>`, the special cases
----------------
RalfJung wrote:

> This is a quick stab at wording, so take it with a grain of salt: "The pow function is one where replacing an sNaN with a qNaN changes the result. Due to LLVM's NaN-propagation rules [link], this means that the function result is effectively nondeterministic when called with an sNaN argument."

I think without an example, this will be very confusing to most readers.

https://github.com/llvm/llvm-project/pull/170177


More information about the llvm-commits mailing list