summaryrefslogtreecommitdiffstats
path: root/llvm/docs
diff options
context:
space:
mode:
authorCameron McInally <cameron.mcinally@nyu.edu>2018-11-16 19:52:59 +0000
committerCameron McInally <cameron.mcinally@nyu.edu>2018-11-16 19:52:59 +0000
commite4ee9849c079d2b21ccd934fdfa2407e5a84c63e (patch)
tree191cca2062d62e1db6b79ec38fab9ddf2d5aa0b1 /llvm/docs
parent2fcdcac4ece2cb1a1168a24c6ca4f94b0a09c735 (diff)
downloadbcm5719-llvm-e4ee9849c079d2b21ccd934fdfa2407e5a84c63e.tar.gz
bcm5719-llvm-e4ee9849c079d2b21ccd934fdfa2407e5a84c63e.zip
[FNeg] Add FNeg Instruction to LangRef document
The FNeg IR Instruction code was added with D53877. Differential Revision: https://reviews.llvm.org/D54549 llvm-svn: 347086
Diffstat (limited to 'llvm/docs')
-rw-r--r--llvm/docs/LangRef.rst52
1 files changed, 49 insertions, 3 deletions
diff --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst
index 739267c8f58..dd822547cef 100644
--- a/llvm/docs/LangRef.rst
+++ b/llvm/docs/LangRef.rst
@@ -6790,6 +6790,55 @@ Semantics:
The '``unreachable``' instruction has no defined semantics.
+.. _unaryops:
+
+Unary Operations
+-----------------
+
+Unary operators require a single operand, execute an operation on
+it, and produce a single value. The operand might represent multiple
+data, as is the case with the :ref:`vector <t_vector>` data type. The
+result value has the same type as its operand.
+
+.. _i_fneg:
+
+'``fneg``' Instruction
+^^^^^^^^^^^^^^^^^^^^^^
+
+Syntax:
+"""""""
+
+::
+
+ <result> = fneg [fast-math flags]* <ty> <op1> ; yields ty:result
+
+Overview:
+"""""""""
+
+The '``fneg``' instruction returns the negation of its operand.
+
+Arguments:
+""""""""""
+
+The argument to the '``fneg``' instruction must be a
+:ref:`floating-point <t_floating>` or :ref:`vector <t_vector>` of
+floating-point values.
+
+Semantics:
+""""""""""
+
+The value produced is a copy of the operand with its sign bit flipped.
+This instruction can also take any number of :ref:`fast-math
+flags <fastmath>`, which are optimization hints to enable otherwise
+unsafe floating-point optimizations:
+
+Example:
+""""""""
+
+.. code-block:: text
+
+ <result> = fneg float %val ; yields float:result = -%var
+
.. _binaryops:
Binary Operations
@@ -6965,9 +7014,6 @@ Overview:
The '``fsub``' instruction returns the difference of its two operands.
-Note that the '``fsub``' instruction is used to represent the '``fneg``'
-instruction present in most other intermediate representations.
-
Arguments:
""""""""""
OpenPOWER on IntegriCloud