[llvm-dev] [FPEnv] FNEG instruction

Cameron McInally via llvm-dev llvm-dev at lists.llvm.org
Wed Aug 29 07:50:51 PDT 2018


Ping...

The current thinking is that FNEG(X) and FSUB(-0.0, X) are not the same
operation when X is a NaN or 0. So, the xforms in question should only be
valid under Fast-Math conditions.

Is correcting this behavior something that the general LLVM population
would like? If not, we can create constrained intrinsics for the FPEnv
project.

Thanks again,
Cameron

On Tue, Aug 21, 2018 at 12:17 PM, Cameron McInally <cameron.mcinally at nyu.edu
> wrote:

> Hey llvm-dev,
>
> Continuing a discussion from D50913...
>
> A group working on the FP rounding mode and trap-safety project have run
> into a situation where it would make sense to add a new FNEG instruction
> and decouple the existing FNEG<->FSUB transformations.
>
> The IEEE-754 Standard (Section 5.5.1) makes it clear that neg(x) and
> sub(-0.0,x) are two different operations. The former is a bitwise
> operation, while the latter is an arithmetic operation.
>
> That said, LLVM currently conflates the two operations in several places.
> It would be nice to separate the two operations to give the user explicit
> control over which type of operation is generated.
>
> D50913 covers a lot of ground, so I'll leave the discussion here for now
> until any interested parties are up to speed.
>
> Thanks for looking,
> Cameron
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180829/9d4b2c68/attachment.html>


More information about the llvm-dev mailing list