<div dir="ltr">On Thu, Aug 30, 2018 at 9:28 AM, James Y Knight <span dir="ltr"><<a href="mailto:jyknight@google.com" target="_blank">jyknight@google.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><div><div class="h5"><div><br><br><div class="gmail_quote"><div dir="ltr">On Thu, Aug 30, 2018, 8:03 AM Cameron McInally via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">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 dir="ltr">On Wed, Aug 29, 2018 at 3:13 PM, Cameron McInally <span dir="ltr"><<a href="mailto:cameron.mcinally@nyu.edu" rel="noreferrer" target="_blank">cameron.mcinally@nyu.edu</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><span>On Wed, Aug 29, 2018 at 1:51 PM, Stephen Canon <span dir="ltr"><<a href="mailto:scanon@apple.com" rel="noreferrer" target="_blank">scanon@apple.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word;line-break:after-white-space"><span class="m_-3210616403670982512m_-7205832705888918678m_-7849455243719463610gmail-"><blockquote type="cite">On Aug 29, 2018, at 1:22 PM, Cameron McInally via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" rel="noreferrer" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br></blockquote><div><blockquote type="cite"><div><div style="font-family:Helvetica;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;font-size:12.800000190734863px"><br class="m_-3210616403670982512m_-7205832705888918678m_-7849455243719463610gmail-m_2919396084355721082Apple-interchange-newline">FSUB(-0.0,  NaN) = NaN</div><div style="font-family:Helvetica;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;font-size:12.800000190734863px">FSUB(-0.0, -NaN) = NaN</div></div></blockquote></div><br></span><div>Some specific architecture may define this, or APFloat might, but IEEE 754 does not interpret the sign of NaN except in four operations (copy, abs, negate, copysign), so it doesn’t say anything about these.</div><div></div></div></blockquote></div><br></div></span><div class="gmail_extra">Good point. I suppose one could argue that the behavior is undefined.</div></div></div></div></div></div>
</blockquote></div><br></div><div class="gmail_extra">Apologies, I was wrong about this one. Just tested the FSUB hardware instruction on all the targets I care about and they all respect the sign on NaNs. I'm not sure how this got into my head...</div></div></blockquote></div></div><div dir="auto"><br></div></div></div><div dir="auto">No, you weren't wrong.</div><div dir="auto"><br></div><div dir="auto">The sign of the NaN result is only defined, per the standard, for those 4 operations, no others. Certain hardware or certain ISAs may make more guarantees, of course.</div></div>
</blockquote></div><br></div><div class="gmail_extra">Yeah, of course, but I'm a pragmatist. ;)</div><div class="gmail_extra"><br></div><div class="gmail_extra">Kidding aside, I've heard a handful of yeas for adding an explicit FNEG instruction. Are there any nays (or maybes) out there? I'd like to hear those concerns...</div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div></div>