[PATCH] D44216: [LangRef] make it clear that FP instructions do not have side effects

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 7 11:59:07 PST 2018


efriedma added inline comments.


================
Comment at: docs/LangRef.rst:3041
+      %A = fadd undef, %X
       %B = fdiv %X, undef
     Safe:
----------------
spatel wrote:
> efriedma wrote:
> > I would rather just rewrite this example so it doesn't use fdiv.
> > 
> > You can make the point this paragraph is trying to make much more clearly and unambiguously using integer sdiv rather than floating-point operations.
> Yes, good point. Do you think there's value in also having the FP examples here to explicitly show the difference between int and FP, or are the additions to the opcode definitions enough?
The additions to the opcode definitions are probably good enough.


================
Comment at: docs/LangRef.rst:6497
 The value produced is the floating-point difference of the two operands.
+This instruction is assumed not to trap or have any other side effects.
 This instruction can also take any number of :ref:`fast-math
----------------
You might also want to mention we assume the default rounding mode, or maybe just the default floating-point environment.  And maybe specifically call out that we assume the user won't read the floating-point exception state.


https://reviews.llvm.org/D44216





More information about the llvm-commits mailing list