<div dir="auto"><div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Jul 9, 2021, 08:41 Kevin Neal via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">






<div>
<font face="Courier New" size="2"><span style="font-size:11pt">
<div>I’m looking at lib/Analysis/InstructionSimplify.cpp where the function propagateNaN() has a comment asking if it should quiet a signaling NaN.</div>
<div><font face="Calibri"> </font></div>
<div>If I understand the IEEE 754-2019 standard correctly: an SNaN shall be converted to a QNaN whenever an “operation” is done. The standard doesn’t say, or I couldn’t find it, exactly _<i>when</i>_ that operation must be done. Which implies that the floating-point
operation could be done by the compiler. In which case folding an instruction that has an SNaN operand should result in a QNaN.</div></span></font></div></blockquote></div></div><div dir="auto"><br></div><div dir="auto">That should work just fine, but only when you know that FP exceptions flags are ignored, since the signalling NaN causes the operation to generate the Invalid exception, and a quiet NaN doesn't generally cause exceptions.</div><div dir="auto"><br></div><div dir="auto">Jacob Lifshay</div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
</blockquote></div></div></div>