[llvm] [LangRef] Clarify specification for float min/max operations (PR #172012)
Ralf Jung via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 12 07:30:13 PST 2025
================
@@ -20379,9 +20301,17 @@ The '``llvm.vector.reduce.fmax.*``' intrinsics do a floating-point
``MAX`` reduction of a vector, returning the result as a scalar. The return type
matches the element-type of the vector input.
-This instruction has the same comparison semantics as the '``llvm.maxnum.*``'
-intrinsic. If the intrinsic call has the ``nnan`` fast-math flag, then the
-operation can assume that NaNs are not present in the input vector.
+This instruction has the same comparison and ``nsz`` semantics as the
+'``llvm.maxnum.*``' intrinsic.
+
+If any of the vector elements is a signaling NaN, the intrinsic will
+non-deterministically either:
+
+ * Return a :ref:`NaN <floatnan>`.
+ * Treat the signaling NaN as a quiet NaN.
+
+If the intrinsic call has the ``nnan`` fast-math flag, then the operation can
+assume that NaNs are not present in the input vector.
----------------
RalfJung wrote:
If the assumption is violated, then ... UB? poison? undef?
https://github.com/llvm/llvm-project/pull/172012
More information about the llvm-commits
mailing list