[PATCH] D49978: LangRef: Clarify expected sNaN behavior for minnum/maxnum

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 31 00:58:45 PDT 2018


arsenm added inline comments.


================
Comment at: docs/LangRef.rst:11486
+the intrinsic lowering is responsible for quieting the inputs to get
+correct behavior (e.g. by using the equivalent of ``llvm.canonicalize``).
+
----------------
hfinkel wrote:
> I don't understand this text because it seems like if the standard says that a QNaN is returned if either input is a SNaN, then why would the lowering need to additionally canonicalize the inputs? It seems like that would not change the result.
The standard says minnum(x, snan) -> qnan. This differs from the behavior from fmin, where fmin(x, snan) -> x.  You need to quiet to get the other operand instead of qnan


https://reviews.llvm.org/D49978





More information about the llvm-commits mailing list