On Mon, 17 Aug 2020, Segher Boessenkool wrote: > Ah, so "When both arguments are NaNs, the return value should be a qNaN" > means the QNaN corresponding to eother x or y. I see, thanks!
Yes. (The precise choice of NaN result given a NaN input is the subject of various "should"s, in 6.2.3 NaN propagation, with the choice between multiple input NaNs to provide the payload unspecified. E.g. RISC-V doesn't propagate NaN payloads at all. On x86, the rules for choosing a NaN result with more than one NaN input are different between x87 and SSE arithmetic. The compiler can ignore these issues, as long as it gets the choice between quiet and signaling NaN correct.) The IEEE 754-2008 min/max operations also do not specify the precise choice of result when the arguments are +0 and -0 in some order, or when they are equal decimal floating-point values with different quantum exponent. The new operations in IEEE 754-2019 treat -0 as less than +0, but still leave the quantum exponent case unspecified. -- Joseph S. Myers jos...@codesourcery.com