[llvm-dev] [FPEnv] FNEG instruction

Cameron McInally via llvm-dev llvm-dev at lists.llvm.org
Wed Aug 29 10:22:12 PDT 2018


On Wed, Aug 29, 2018 at 12:16 PM, Tim Northover <t.p.northover at gmail.com>
wrote:

> On Wed, 29 Aug 2018 at 07:51, Cameron McInally via llvm-dev
> <llvm-dev at lists.llvm.org> wrote:
> > The current thinking is that FNEG(X) and FSUB(-0.0, X) are not the same
> operation when X is a NaN or 0.
>
> Do you mean denormals (when flushed) rather than 0 there? AFAIK it's
> OK for 0 itself.


Bah, you're correct. 0s are fine. That's assuming the xform is always to
FSUB(-0.0,X) and not FSUB(0.0,X).

NaNs are not ok. I.e.:

FNEG( NaN) = -NaN
FNEG(-NaN) =  NaN

FSUB(-0.0,  NaN) = NaN
FSUB(-0.0, -NaN) = NaN

Thanks for the correction, Tim.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180829/4c50066c/attachment.html>


More information about the llvm-dev mailing list