> On Aug 29, 2018, at 1:22 PM, Cameron McInally via llvm-dev <llvm-dev at lists.llvm.org> wrote: > > FSUB(-0.0, NaN) = NaN > FSUB(-0.0, -NaN) = NaNSome 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. – Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180829/843b4613/attachment.html>
On Wed, Aug 29, 2018 at 1:51 PM, Stephen Canon <scanon at apple.com> wrote:> On Aug 29, 2018, at 1:22 PM, Cameron McInally via llvm-dev < > llvm-dev at lists.llvm.org> wrote: > > > FSUB(-0.0, NaN) = NaN > FSUB(-0.0, -NaN) = NaN > > > 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. >Good point. I suppose one could argue that the behavior is undefined. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180829/977ffed9/attachment.html>
On Wed, Aug 29, 2018 at 3:13 PM, Cameron McInally <cameron.mcinally at nyu.edu> wrote:> On Wed, Aug 29, 2018 at 1:51 PM, Stephen Canon <scanon at apple.com> wrote: > >> On Aug 29, 2018, at 1:22 PM, Cameron McInally via llvm-dev < >> llvm-dev at lists.llvm.org> wrote: >> >> >> FSUB(-0.0, NaN) = NaN >> FSUB(-0.0, -NaN) = NaN >> >> >> 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. >> > > Good point. I suppose one could argue that the behavior is undefined. >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... -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180830/8217b86a/attachment.html>